mIRC Home    About    Download    Register    News    Help

Print Thread
#26470 27/05/03 08:33 PM
Joined: May 2003
Posts: 9
E
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
E
Joined: May 2003
Posts: 9
Hey people,
I'm drawing a blank here. Can anyone tell me how to get the output of /userhost into a variable?

Or maybe a better question would be putting a users address into a variable who isn't in the channel and doesn't have an entry in the ial.

Thanks

#26471 28/05/03 04:07 AM
Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
Code:
alias gethost { .userhost $ | .enable #uh }
#uh off
raw 302:*:{
  set %uh $gettok($2,2,64)
  .disable #uh
}
#uh end

That code should work on all servers, there is a simpler way which you just need to use $address or $mask, but some servers won't let you do that, so yeah, that one should be good.


- cF
Dedicated helper for rent.
#26472 28/05/03 04:08 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Userhost can have more than one nick (up to 5 nicks) in one line, so you need to loop.
Code:
raw 302:*: {
  var %i = 1
  while $gettok($2-,%i,32) {
    var %a = $replace($ifmatch,=+,!,=-,!,*=+,!,*=-,!)
    set %address $+ $gettok(%a,1,33) %a
    echo -s Do something with the address:-> %a
    inc %i
  }
  halt
}


Edit:
Changed $remove($replace($ifmatch,=,!),+,-,*) to $replace($ifmatch,=+,!,=-,!,*=+,!,*=-,!)
Thanks for pointingt that out Online smile

Last edited by Nimue; 28/05/03 04:24 AM.

Link Copied to Clipboard