Question about union script

Forum for alternative clients, mods & discussions on the same.

Moderator: Phades

ItsJustMe
Posts: 5
Joined: Thu Feb 13, 2014 10:51 am

Question about union script

Post by ItsJustMe »

So i just started creating some scripts and i'm trying to get a sort of own menu ready.

Setting up a window is rather easy done with:

Code: Select all

var Test = jGUIWindow(jCoord(10,10), jCoord(100,100), "Test");
and getting a button also.

but how do i get a button listener that fires onclick?

thx for your help
User avatar
Lordtimo
Posts: 437
Joined: Wed Jun 01, 2011 12:00 pm

Re: Question about union script

Post by Lordtimo »

If you mean that the bot does smth if you click a button then this is how you wanna do it:

Code: Select all

var blist = ["Button1", "Button2","Exit"];
var selectWindow = jGUIWindow(jCoord(250, 250), jCoord(215, 160), "MyFirstBot");
var label = jGUILabel(selectWindow, jCoord(65, 5), "Buttons:");

jGUIButton(selectWindow, jCoord(55, 25), 100, blist[0]); // Button1
jGUIButton(selectWindow, jCoord(55, 50), 100, blist[1]); // Button2
jGUIButton(selectWindow, jCoord(55, 75), 100, blist[2]); // Exit

selectWindow.toggleCloseButton();
var btext = selectWindow.waitButtonClick();

if (btext == blist[0]) {
		selectWindow.destroy();
		//"doShitForButton1();"
	}
	if (btext == blist[1]) {
		selectWindow.destroy();
		//"doShitForButton2();"
	}
if (btext == blist[2]) {
		selectWindow.destroy();
		return;
	}
selectWindow.destroy();
ItsJustMe
Posts: 5
Joined: Thu Feb 13, 2014 10:51 am

Re: Question about union script

Post by ItsJustMe »

Lordtimo wrote:If you mean that the bot does smth if you click a button then this is how you wanna do it:
thx a lot
was exactly what i was looking for
User avatar
Lordtimo
Posts: 437
Joined: Wed Jun 01, 2011 12:00 pm

Re: Question about union script

Post by Lordtimo »

No problem, guess this can be closed then.

Return to “The Wizards' Tower”