mIRC Homepage

Need help on scripts..

Posted By: zshadow

Need help on scripts.. - 16/12/04 03:28 AM

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
Posted By: ethorn01

Re: Need help on scripts.. - 16/12/04 06:32 AM

use (undernet server is the example)
if (undernet isin $server) {
commands
}
Posted By: Coolkill

Re: Need help on scripts.. - 16/12/04 07:11 AM

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.
Posted By: tidy_trax

Re: Need help on scripts.. - 16/12/04 11:41 AM

It would be better to check $network:

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

Re: Need help on scripts.. - 26/12/04 07:29 PM

thanks, works great smile
© 2020 mIRC Discussion Forums