mIRC Home    About    Download    Register    News    Help

Print Thread
#220953 04/05/10 02:21 AM
Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
i have a random nick script but i want it to be performed when i got a message like this "Nickname already in use" so basicaly if i typed in a nick if it is already in use this script will autorun...


Code:
alias randomnick {
  nick $+(random],$regsubex($str(.,$r(5,5)),/./g,$r(a,z)))
}


Joined: Nov 2009
Posts: 81
V
Babel fish
Offline
Babel fish
V
Joined: Nov 2009
Posts: 81
Code:
raw 433:*: {
  randomnick
}

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
raw 433:*: { nick $+([random],$regsubex($str(.,$r(5,5)),/./g,$r(a,z))) | halt }

Tomao #220960 04/05/10 06:35 AM
Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
thankz for the help... very much appreciated

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
nick $+(random],$regsubex($str(.,$r(5,5)),/./g,$r(a,z)))

u do realise that $r(5,5) will always return 5 right?
and that in /./g the "." needs to be exscaped, right: /\./g


I am SReject
My Stuff
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
The "." doesn't need to be escaped; a "." in a regular expression matches any single character. So . and \. will have the same effect in this case.

hixxy #221089 07/05/10 10:40 AM
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
yea, now that u said something, I realise it, but i think ol' buddy was trying to match "." instead of "any one char". All in the inner workings i guess smile


I am SReject
My Stuff

Link Copied to Clipboard