mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2004
Posts: 23
X
x3RiouS Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: May 2004
Posts: 23
How can I get a variable value in the following way? :
msg $nick Please Enter a value:

And I'll be able to put the value he sends in a variable.

Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
on *:Text:*:?: {
set %var. [ $+ $nick ] ] $1-
}

this will set a variable with the nicks name everytime he msgs you.

Hope it does it smile
Zyzzy;


"All we are saying is give peace a chance" -- John Lennon
Joined: May 2004
Posts: 23
X
x3RiouS Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: May 2004
Posts: 23
Thank you, yet that wasn't really what I meant.
I'll try making myself more clear by giving the following example which I have:
Code:
ON +100:text:start gather:?: {
  msg $nick Please Enter a map:

*here I want to set a variable named %map with a given value*
Code:
  msg $nick The gather has started
  set %alpha. 0
  set %bravo. 0
  .enable #gather 
  msg #Chan A Gather Has Started. Map: %map . Admin: $nick . Say !addme to play in the gather

Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Code:
ON +100:text:*:?: {
[color:green];This checks to see if start gather is in the message.
; If it is, then its sends a message[/color]
  if ($1 == start) && ($2 == gather) {
   msg $nick Please Enter a map:
   inc %started
   return
 }
[color:green]; This part check to see if "start gather" was sent before, and if it has, then sets the var %map to the text the nick sends.[/color]
 if (%started) {
  set %map $1-
  unset %started
 }
}


Im not sure if this does it, but i hope it does smile

Zyzzy.



"All we are saying is give peace a chance" -- John Lennon
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Code:
ON +100:text:*:?:{
  var %action = $hget(gather,$fulladdress)
  if ($1- == start gather) { msg $nick Please Enter a map: | gatherset map | return }
  if (%action == map) { check for map name | return }
  if (%action == whatever else) { commands/actions | return }
}
alias gatherset { hadd -m gather $fulladdress $1- }


See if that works for you.

Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Instead of "if ($1 == start) && ($2 == gather) {"
you can use "if ($1- == start gather) {" or to only check $1 and $2, "if ($1-2 == start gather) {"

cool

Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Cool, didnt know about that laugh

Thanks!


"All we are saying is give peace a chance" -- John Lennon

Link Copied to Clipboard