GUI.BashingIcon:setClickCallback("GUI.Clicky","You clicked me!")
function GUI.Clicky(arg)
echo(arg)
end
That should echo You clicked me! when GUI.BashingIcon is clicked though the way Jor'Mox mentioned should work just fine. This is the OO way via Geyser.
GUI.BashingIcon:setClickCallback("GUI.Clicky","You clicked me!")
function GUI.Clicky(arg)
echo(arg)
end
That should echo You clicked me! when GUI.BashingIcon is clicked though the way Jor'Mox mentioned should work just fine. This is the OO way via Geyser.
Nope I been doing it that way, I think its having isssues with letting me click the 'image' so I had to do it this way
*There's a note in that link that mentions you not being able to include callback functions in a table but I think its outdated info and you actually CAN include them in a table.
Event handlers working with function in tables made my life so much easier. Though, I still don't understand the motivation for the regular event registering system. Why would I want my script to depend on what it is called in order to function?
I seem to remember it stating that you listed the events in the "Add User Defined Event Handler" box at the top of a script, and when those events fired, they were handled by a function with the same name as the script.
Registering an event handler via UI
Registering an event handler means that you’ll be telling Mudlet what function should it call for you when an event is raised, so it’s a two step process - you need to tell it both what function you’d like to be called, and on what event should it be called.
To tell it what function should be called, create a new script, and give the script the name of the function you’d like to be called. This is the only time where an items name matters in Mudlet. You can define the function right inside the script as well, if you’d like.
Next, we tell it what event or events should this function be called on - you can add multiple ones. To do that, enter the events name in the Add User Defined Event Handler: field, press enter, and it’ll go into the list - and that is all.