25 replies to this topic
#21
Posted 19 August 2013 - 08:34 AM
Nice API! Will definitely help with my Redstone stuff.
#22
Posted 27 August 2013 - 03:08 PM
hello i love your api but i have a little problem maybe you can help i am linking whit the draw butten and fuction funcion of the buttons to a other function whit a button from this api in it but that button wont work i will post a pastebin link in a edit as you dont understand
#23
Posted 28 August 2013 - 12:53 AM
eningly, on 27 August 2013 - 03:08 PM, said:
hello i love your api but i have a little problem maybe you can help i am linking whit the draw butten and fuction funcion of the buttons to a other function whit a button from this api in it but that button wont work i will post a pastebin link in a edit as you dont understand
#24
Posted 28 August 2013 - 02:57 AM
http://pastebin.com/JRUD9fFh
this is te link but it is a little bit of your script whit some more code
this is te link but it is a little bit of your script whit some more code
#25
Posted 28 August 2013 - 06:53 AM
Why is ther so often:
And now to your problem:
you create a new button (line 23) an the same coordinates b1 (line 37) is bevor. But the getButton function will find the first createt button (in that case b1 from line 37) first and return it. So the other b1 (line 23) will never get found.
if you wanna do this, you have do deactivate your buttons and than make a new on the same coordinates:
or
just override the function of b1 so you don't have to create it again
--------------------
but thanks.
you gave me some ideas to improve the api to handle this problem
funct=function() endI can't see what this is good for.
55. obj.runFunction(1,termY)you wanna run a function whit parameter. Thats fine and will work. BUT you have du implement your functions so, they can handle these parameter.
39. b3 = button.newButton({title='b3';posX=5;posY=10;width=9;height=3;active=true;funct=function(x,y) term.setCursorPos(x, y)write(5) end})
And now to your problem:
you create a new button (line 23) an the same coordinates b1 (line 37) is bevor. But the getButton function will find the first createt button (in that case b1 from line 37) first and return it. So the other b1 (line 23) will never get found.
23. b1 = button.newButton({title='back';posX=5;posY=2;width=9;height=3;active=true;funct=function() print("hello worlfd") end;})
-- snipe --
37. b1 = button.newButton({title='pass';posX=5;posY=2;width=9;height=3;active=true;funct=function() pass() end})
if you wanna do this, you have do deactivate your buttons and than make a new on the same coordinates:
b1.setActive(false)
or
just override the function of b1 so you don't have to create it again
b1.setFunction(function() print("hello worlfd"))
--------------------
but thanks.
you gave me some ideas to improve the api to handle this problem
#26
Posted 28 August 2013 - 07:53 AM
oke thanks man jhe the trash code whas for figgering it out myself oke now i understand thanks
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











