mIRC Home    About    Download    Register    News    Help

Print Thread
#222557 23/06/10 05:18 PM
Joined: Jun 2010
Posts: 5
V
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
V
Joined: Jun 2010
Posts: 5
So I'm trying to set up some variables in the on load section of my script and want to prompt the users for the information. So I did the following:

var %xhBotName = $?"What would you like your bot to be called (e.g. TPUBOT, ChanBot)"
var %xhChanName = $?="What is the name of your guild Channel (e.g. %xhEnabled)"
var %xhGuildName = $?="What is the abbreviation for your guild (e.g. TPU, RLOF, etc)"

I'm having two problems, first off only the first prompt is coming up. Second even though the first prompt comes up it doesn't create the variable xhBotName or obviously enter the value entered into it. Any suggestions?

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
First off, see /help Variables

You're setting local variables instead of global variables.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You should use the global variable for each prompt:
Quote:
set %xhBotName $$?="What would you like your bot to be called (e.g. TPUBOT, ChanBot)"
set %xhChanName $$?="What is the name of your guild Channel (e.g. %xhEnabled)"
set %xhGuildName $$?="What is the abbreviation for your guild (e.g. TPU, RLOF, etc)"
And make the $? and double $$? so you don't get the var set without a value being entered when you close it.

Ok 5618 beat me to it.

Last edited by Tomao; 23/06/10 05:32 PM.
Tomao #222560 23/06/10 05:29 PM
Joined: Jun 2010
Posts: 5
V
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
V
Joined: Jun 2010
Posts: 5
Ok, thanks folks. Now I'm at the point where xhBotName gets set. But I still don't get the second or third prompt. Any ideas on that?

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Oh my bad. You need to remove the equals sign next to the vars when you set them as global variables.

Tomao #222562 23/06/10 05:38 PM
Joined: Jun 2010
Posts: 5
V
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
V
Joined: Jun 2010
Posts: 5
Yeah, so this is what I have at this point.

set %xhBotName $$?="What would you like your bot to be called (e.g. TPUBOT, ChanBot)"
set %xhChanName $$?="What is the name of your guild Channel (e.g. %xhEnabled)"
set %xhGuildName $$?="What is the abbreviation for your guild (e.g. TPU, RLOF, etc)"

Which works for BotName, but then doesn't prompt for ChanName or GuildName. In fact as a test after the three prompt I did "set %xhBotName DONE" and after loading the script the variable contained the value I entered, not DONE. So it's like it stops executing after the first prompt.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Your problem is that it sees %xhEnabled) as an actual variable and it fails on that.

Use $chr(37) $+ hEnabled)

But I think you don't want %xhEnabled there at all? Don't you want an example of a channel name? Or do you want the value of the variable there?

Last edited by 5618; 23/06/10 05:42 PM.
5618 #222564 23/06/10 05:43 PM
Joined: Jun 2010
Posts: 5
V
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
V
Joined: Jun 2010
Posts: 5
Ah thanks, actually that was just fallout from a previous find and replace. It's working now. Really appreciate the very quick help here guys smile


Link Copied to Clipboard