mIRC Home    About    Download    Register    News    Help

Print Thread
#105436 16/12/04 03:28 AM
Joined: Jun 2004
Posts: 3
Z
zshadow Offline OP
Self-satisified door
OP Offline
Self-satisified door
Z
Joined: Jun 2004
Posts: 3
Is there any tutorials on how to make scripts such as:

- when anyone in a channel sets mode -o on my nick I automatically /msg chanserv op #channel .. but I would like to set this for one network only, not all

- I connect to network a, set a certain mode, then mirc connects to the channels I want .. I can do this using the perform function, but if the /mode command failed it'd still join the channels.. if the mode command fails I do not want to join the channels

thanks smile

#105437 16/12/04 06:32 AM
Joined: Dec 2004
Posts: 23
E
Ameglian cow
Offline
Ameglian cow
E
Joined: Dec 2004
Posts: 23
use (undernet server is the example)
if (undernet isin $server) {
commands
}

#105438 16/12/04 07:11 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
ethorn01; iswm would have be a better alternative, although isin will 'do'.

zshadow; the best place to start would be google there are endless websites out there, some of which can be reached via, http://www.mirc.com/links.html.

As for your suggested scripts;

Quote:
I connect to network a, set a certain mode, then mirc connects to the channels I want .. I can do this using the perform function, but if the /mode command failed it'd still join the channels.. if the mode command fails I do not want to join the channels


This is pretty simple, remove all your commands from the Perform that relate to the above.., and use the following code:

on *:connect:{

; trigger on connect.
if ($network == [color:red]networkname) {[/color]
; if the network is called 'networkname' then run the following (You can find the network name by //echo network: $network).
var %mode = [color:red]modegoeshere[/color]
Change 'modegoeshere' to the mode your trying to set on connect (i.e. R)
mode $me $+(+,%mode)
; sets the mode to your nickname
.timerchkmode 0 3 chk.mode %mode
; runs a timer every 3 seconds trying to tell if the mode has been set or not.
}
}

alias chk.mode {
if ($1 isin $usermode) { join [color:red]#yourchannel
| .timerchkmode off }
[/color]; alias to check if the mode is set, if so join channel
}


Quote:
when anyone in a channel sets mode -o on my nick I automatically /msg chanserv op #channel .. but I would like to set this for one network only, not all


This would be done as follows:

On *:DEOP:[color:red]#channel
:{
[/color];ON DEOP on '#Channel', use just # for all channels.
if (($opnick == $me) && ($nick ison $chan)) {
; if the nick deopped was me, and the person who deopped me is on the channel (stops you trying to reop if chanserv/IRCop from outside the channel deop you)
msg chanserv op $chan
; send this command to chanserv
}
}


You might want to add a variable that counts the number of times you have tried (and unsuccessfully reop'd) to avoid a flood.
Eamonn.


Eamonn.

#105439 16/12/04 11:41 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
It would be better to check $network:

Code:
if ($network === Undernet) {
  <stuff>
}


New username: hixxy
#105440 26/12/04 07:29 PM
Joined: Jun 2004
Posts: 3
Z
zshadow Offline OP
Self-satisified door
OP Offline
Self-satisified door
Z
Joined: Jun 2004
Posts: 3
thanks, works great smile


Link Copied to Clipboard