Posted 06 March 2014 - 09:58 AM
Hello again. Today i tried making an api that will "help" me with other scripts. It basicly is supposed to spawn a button to an attached monitor at the top of the computer with x and y being its starting point, t being the text, tc and bc are text color and background color. But im having an issue. When i open the interactive lua prompt, i load the api, and then type button.spawn(1,1,test,colors.white,colors.black) i get an error: "button:6: attempt to concatenate string and nil". As my research goes, i could not find solution to it as of now. Thats im asking you!
Link to the script:http://pastebin.com/kLwAFZYZ
Link to the world:https://www.google.com/
The only time IT WORKS is when i set x,y and t to NUMBER values. Aka
button.spawn(1,1,5,colors.white,colors.black)
EDIT: FIXED IT! I just needed to use " and " for the text input ( aka button.spawn(1,1,"InputTextHere",colors.white,colors.black)
i will keep the thread just if someone has the same problem as me. You can awesoe, if you want, use the API for your scripts, if it is in any use for you
Link to the script:http://pastebin.com/kLwAFZYZ
Link to the world:https://www.google.com/
The only time IT WORKS is when i set x,y and t to NUMBER values. Aka
button.spawn(1,1,5,colors.white,colors.black)
EDIT: FIXED IT! I just needed to use " and " for the text input ( aka button.spawn(1,1,"InputTextHere",colors.white,colors.black)
i will keep the thread just if someone has the same problem as me. You can awesoe, if you want, use the API for your scripts, if it is in any use for you
Edited on 06 March 2014 - 09:08 AM