mIRC Home    About    Download    Register    News    Help

Print Thread
#101523 25/10/04 12:39 PM
Joined: May 2004
Posts: 49
G
GalaxeY Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: May 2004
Posts: 49
Auto Slap
.On:{ if (%aslap = $null) { set %aslap 1 | echo -a Auto Slap Is On } }
.Off:{ if (%aslap = 1) { set %aslap | echo -a Auto Slap Is Off } }

on *:action:slaps *:#:{
if (%aslap = 1) { describe # slaps $nick around a bit with a large trout
}
else {
halt
}
}

Can I do this more shorter?


Signature:
I'm boring, ain't I? Oh well...:|
#101524 25/10/04 01:16 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Well, ignoring unncessary { }, you could shorten the On/Off popup:

.On:{ set %aslap 1 | echo -a Auto Slap Is On }
.Off:{ unset %aslap | echo -a Auto Slap Is Off }

You don't need the if statement, because if you set it 'On' then %aslap will have the value of '1', and if you set it off, %aslap no longer exists.

You can also shorten the on action event:

on *:action:slaps *:#:{
if (%aslap = 1) {
describe # slaps $nick around a bit with a large trout
}
}

You don't need to tell the script to halt, it will only trigger if %aslap is '1' anyway. So if it isn't 1, it won't do anything.

Regards,


Mentality/Chris
#101525 25/10/04 01:45 PM
Joined: May 2004
Posts: 49
G
GalaxeY Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: May 2004
Posts: 49
Thanks laugh


Signature:
I'm boring, ain't I? Oh well...:|
GalaxeY #184348 28/08/07 12:19 AM
Joined: May 2004
Posts: 49
G
GalaxeY Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: May 2004
Posts: 49
SOrry for dubble post but how can I make it so it just is for me?


Signature:
I'm boring, ain't I? Oh well...:|
GalaxeY #184396 28/08/07 01:10 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
ON *:Action:$(slaps $me *):#:  describe # slaps $nick around a bit with a large trout

SladeKraven #184561 30/08/07 10:42 AM
Joined: Jul 2006
Posts: 10
G
Pikka bird
Offline
Pikka bird
G
Joined: Jul 2006
Posts: 10
Originally Posted By: SladeKraven
Code:
ON *:Action:$(slaps $me *):#:  describe # slaps $nick around a bit with a large trout
change the second # to $chan. otherwise you'll be doing it on whatever channel is active

Gubment_Cheez #184563 30/08/07 10:53 AM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Not really, in a remote, # is equal to $chan, not to the active channel


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard