ULX

Author Topic: How to make custom buttons to Prop Hunt menu?  (Read 1945 times)

0 Members and 1 Guest are viewing this topic.

Offline hej

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
How to make custom buttons to Prop Hunt menu?
« on: November 26, 2014, 02:58:40 PM »
Hey you guys, is there an easy way to create a button like this:




(This picture is not from my server.)

Im using prophunt by AMT.
I want to have one of the buttons linked to the public pointshop and on of the buttons linked to ULX motd.


Is there an easy way to do this? Im not an advanced lua scripter at all. I guess thats why we have this forum right?

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: How to make custom buttons to Prop Hunt menu?
« Reply #1 on: November 26, 2014, 05:10:39 PM »
The board here is more for ULX help– Developers' Corner is what you're looking for if you need code help. :P
If there's one thing I've learned over years of coding, it's that one of the best ways to get something done that you're not sure how to do is study, guess, check, and debug.
Try searching the Prop Hunt code and see if you find something like the menu you want to edit. Examine the code– see how they do it. Then, try your hand at it; a simple cut, paste and edit might just work. Load it up in a dev environment and test away.
Lua stacktraces, if you happen to get errors, are usually very informative. Let's take a look at one:
Code: [Select]
> error("Whoops!")
stdin:1: Whoops!
stack traceback:
[C]: in function 'error'
stdin:1: in main chunk
[C]: in ?
Breaking this down, here is what we get:
Code: [Select]
> error("Whoops!")
That's the code I ran to force an error. It doesn't do anything other than, well, throw an error.

Code: [Select]
stdin:1: Whoops!
There's always this same, information-packed pattern in the start of these, and it looks like this:
ErrorAt:Line#: Error Message
ErrorAt you probably won't need
 Line# is what line in the code the initial detected error is on. This does not mean this is your only error!
Error Message is a short summary of what happened. It usually makes debugging simple.

Code: [Select]
stack traceback:
[C]: in function 'error'
stdin:1: in main chunk
[C]: in ?
This is your stack trace. This contains a bunch of similarly formatted entries like error messages, but they are not errors. Instead, it's a step back to everything building up to running your currently errant code. Good practice is to step back through these lines, files, etc– make sure everything is in line.
If you're truly stumped after debugging, this is when we or StackOverflow like sites or people are great resources to hit up.
bw81@ulysses-forums ~ % whoami
Homepage