|
|
Joined: Feb 2004
Posts: 1
Mostly harmless
|
OP
Mostly harmless
Joined: Feb 2004
Posts: 1 |
it might be helpful if for certain commands there was another parameter for network...such as for the /msg #channel command and On Text
this would be helpful for us that run the same bot on multiple networks but only wish things to be done on certain channels on certain networks..
for example I run the a channel by the same name on 2 different networks. what I'd like to do is take all things said in 1 channel and message them to the other channel on the other network.... Format: on <level>:TEXT:<matchtext>:<*><?><#[,#]>,<@network>:<commands> example: on ^1:text:*:#terrortories,@funnet.org:/msg #terrortories @gamesnet.net < $+ $nick $+ > $1-
I do know certain scripting methods to achieve this, but they tend to be drawn out and require a lot of extra thought..
here are some that could benefit from an option <network> parameter: On Text on Part On Join /msg /describe
|
|
|
|
Joined: Jun 2003
Posts: 5,024
Hoopy frood
|
Hoopy frood
Joined: Jun 2003
Posts: 5,024 |
A simple if statement can help: if ($network == Networkname) { do stuff } i.e. on *:text:*:#terrortories:{ if ($network == Funnet) { scon 2 msg #terrortories < $+ $nick $+ > $1- } }The '2' assumes that the network you're messaging (Gamesnet) is the second one in your switchbar (the second one connected to). Also see /help if then else and /help /scon. Note: you only need to use the ^ prefix when halting text, and it appears you're not, so I removed it. And make sure you see qwerty's good point below Regards,
Last edited by Mentality; 02/12/04 10:37 PM.
Mentality/Chris
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
alias get.scon {
if ($1 != $null) {
var %i = $scon(0)
while (%i) {
if ($scon(%i).network == $1) return %i
dec %i
}
}
return 0
}
(there might be a better way of getting then i dont know it) add that somewhere then use on ^1:text:*:#terrortories:if ($network = funnet.org) { /scon $get.scon(gamesnet.net) msg #terrortories < $+ $nick $+ > $1- } PS im assuming funnet.org and gamesnet.net are the $network names here and not funnet and gamesnet, correct as needed.
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
$1- inside /scon is a big no-no. If $1- contains identifier strings, those will be evaluated, so imagine what can happen if somebody says something about $findfile(). The simplest safe way to do it is on ^*:text:*:#terrortories:{
if ($network == Funnet) {
scon $$get.scon(gamesnet.net)
msg #terrortories $+(<,$nick,>) $1-
scon -r
}
}
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
yep i didnt focus on that i must admit, just looked at getting the msg to the right network, would be better to put the whole lot in an alias so hes just got a /msg.network networkname reciever message, and it does all that in it etc etc
|
|
|
|
Joined: Aug 2004
Posts: 42
Ameglian cow
|
Ameglian cow
Joined: Aug 2004
Posts: 42 |
$network doesnt work on all networks. I think it was "newnet" that didnt allow it for some reason. I didnt get any answer from their help channel as to why it doesnt work.
|
|
|
|
Joined: Jun 2003
Posts: 5,024
Hoopy frood
|
Hoopy frood
Joined: Jun 2003
Posts: 5,024 |
Hm, works here, although I didn't try all their servers.
As far as I know, it's a line in the IRCd which sets the network's name and where mIRC gets $network from.
Regards,
Mentality/Chris
|
|
|
|
Joined: Dec 2002
Posts: 774
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 774 |
005 numeric contains network, if it does $network will be filled from there, if not, mIRC looks the server from servers.ini and if found uses the group as $network.
IRCnet didn't suppot 005 in the past, don't know what the situation is today.
//if ( khaled isgod ) echo yes | else echo no
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
mIRC can also get the network name from numeric 001, the original method of obtaining it - apart from the group name in servers.ini.
|
|
|
|
|
|