Jump to content




help with buttons

computer help lua

  • You cannot reply to this topic
4 replies to this topic

#1 joshgreat

  • Members
  • 33 posts

Posted 26 July 2017 - 11:14 AM

hey guys im having a problem with a chunk of my code, it doesnt throw an error though.

basically i am making an app store and i have made buttons, the buttons work on the rest of the OS but on this part they dont, i click them and nothing happens

the code is in the pastebin bellow
https://pastebin.com/2i6QbhxH
or
pastebin get 2i6QbhxH

thanks in advance

#2 The Crazy Phoenix

  • Members
  • 136 posts
  • LocationProbably within 2 metres of my laptop.

Posted 26 July 2017 - 11:57 AM

Are you using an advanced computer / monitor? "mouse_click" only works on advanced.
If you're only planning on listening to the "mouse_click" event, use os.pullEvent("mouse_click") so that you don't have to manually filter events.

The given snippet of code won't compile because there are 2 "end" statements too many.

#3 joshgreat

  • Members
  • 33 posts

Posted 26 July 2017 - 12:19 PM

hi thanks for answering so fast.

i am using an advanced computer but the amount of "end" statements are fine and if i add more or take away more i get an error.

EDIT : The buttons are formatted the same throughout the whole program and they work fine but this doesn't.

Edited by joshgreat, 26 July 2017 - 12:21 PM.


#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 26 July 2017 - 01:37 PM

This sort of thing:

cx < choice1:len()

... should be along the lines of this sort of thing:

cx < x1 + choice1:len()

The reason you need your excess "end"s is because you're using "else if" where you could be using "elseif".

#5 joshgreat

  • Members
  • 33 posts

Posted 27 July 2017 - 02:31 PM

 Bomb Bloke, on 26 July 2017 - 01:37 PM, said:

This sort of thing:

cx < choice1:len()

... should be along the lines of this sort of thing:

cx < x1 + choice1:len()

The reason you need your excess "end"s is because you're using "else if" where you could be using "elseif".
sadly this doesnt seem to be the case as i modified the code for a couple of functions, the app store code still didnt work and the other stopped working, and i dont use 'elseif' because i am used to using 'else if'

EDIT: Nvm i was modifying the wrong thing sorry about that, but nevertheless thank you so much for the help

Edited by joshgreat, 27 July 2017 - 02:33 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users