|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2004
Posts: 714 |
I did a search on this and i didn't find anything, but again, im not very good at searching, so if this question has been asked and answered before, tell me where  Is there a possible way to assign different variables to different networks? I mean, i'm building a bot and i want it to be in 2 different networks at the same time. One of those networks has a Nick Serv so in its userlist it would just be 1000:Zyzzyx26!*@*The thing is that the second network doesnt have a Ns service, but a ip masking one (username.users.undernet.org) - so, in its userlist it would be 1000:*!*@Zyzzyx26.users.undernet.orgOk, so far so good.. but what if someone with the nick Zyzzyx26 joins Undernet (no nickserv) and uses 1000:Zyzzyx26!*@* to get access to the bot? Is there a way to set 1000:Zyzzyx26!*@* only to one specific network? Thanks a lot, Zyzzy.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Nov 2003
Posts: 67
Babel fish
|
Babel fish
Joined: Nov 2003
Posts: 67 |
You can use $network identifier.
if ($network == Undernet) { commands }
You can use /auser 1000 address network and then $ulist with .info propertie
irc.universochat.net #escripting
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Oh, its a very good idea! Though ive come to a problem lol.. When the bot is in 2 different networks and i tell it to op me in #chanA (in network1), if the $active of the bot is in network2 it wont work, since im not in #chanA in net2, but in #ChanA in net1  If anyone has an answer, please come forward  Thanks, Zyzzy.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
You use /scid or /scon to perform the command on the appropriate connection.. Here is a simple alias to find the CID of a particular network. alias n-cid var %a | scon -a if $1 == $!network $eval({ var %a = $cid },0) | return %a Example... - scid $n_cid(Undernet)
mode #chanA o Zyzzyx26
Here is the same alias except this finds the CID by server name alias s-cid var %a | scon -a if $1 == $!server $eval({ var %a = $cid },0) | return %a
|
|
|
|
Joined: Jan 2003
Posts: 428
Fjord artisan
|
Fjord artisan
Joined: Jan 2003
Posts: 428 |
As long as you are aware that not ALL servers fill the $network identifier - IRCnet, for example, has several that do not. So check before trying to use!  PM
IRCnet & DALnet @#travelersinn :-: IRC for fun and relaxation :-:
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Mistake fixing:  - scid $$n-cid(Undernet)
mode #chanA o Zyzzyx26
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Oh, thats a nice command!  I had seen it before, but was never curious enough to dig in and find out about it :P I made sth that tells me in what Nets the bot is right now: ctcp 900:scid*:*: {
unset %nets
var %scid.total = $scid(0)
var %i = 1
while (%i <= %scid.total) {
set % [ $+ [ $scid(%i).$network ] ] $scid(%i)
set %nets %nets $+ $chr(32) $+ $scid(%i).$network
inc %i
}
.notice $nick I am in: %nets
}
It also sets a var called %[network_name] which contains the $cid of that network. Its useful IF i knew what to do with it lol  I mean, how do i tell the bot to use this or that command in the right network? Do i have to add a /scid in every command of the bot?? Or is there a way to tell the bot to switch its $active to the network with $cid = 1 ? (that last question sounds confusing :P) Thank you very much, Zyzzy.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
ctcp 900:scid*:*: { - var %nets
scid -at1 $(var %nets = %nets $network,0) .notice $nick I am in: %nets
} You might also use that idea, along with $findtok, to figure out what the $scon numbers are you might need if you want to /scon N commandalias getNScon { - var %networks
scon -at1 $(%networks = %networks $me $+ : $+ $network,0) return $findtok(%networks, $1, 1, 32)
} alias getSScon { - var %servers
scon -at1 $(%servers = %servers $me $+ : $+ $network,0) return $findtok(%servers, $1, 1, 32)
} $getNScon(DALnet) or $getSScon(mesra.kl.my.dal.net)
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Dec 2002
Posts: 102
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 102 |
You can also manually add the server to your servers list specifying which network it's part of.  mIRC will check your own personal server list when it looks up $network and can use that to ensure that the identifier still works as intended even on servers that don't support the other methods.
- MIMP
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Thanks for the tips given, they work!  However the whole thing is still messy  Let's say i have my bot in Undernet and DALnet and I am only in Undernet. Now, i want to change modes in the DALnet chan, so i'd have to make my bot do this: /scon %DALnet /mode #chan <modes>(presuming its already set with the ctcp scid command)right? well.. the bot already has the channel mode script in it: ctcp 500:cmode*:*: {
if ($me isop $$2) {
mode $$2 $$3-
.notice $nick Changed channel mode to $$3-
halt
}
} So i changed that to this: ctcp 500:cmode*:*: {
if ($me isop $$3) {
scon [color:blue]$$2[/color] mode $$3 $$4-
.notice $nick Changed channel mode to $$4-
halt
}
} The ctcp command would be: /ctcp <bot_nick> %Network.var cmode #channel <modes> - isnt it? Assuming the code is right, it doesnt work.. so it must be wrong :P But where? I also tried this thing: ctcp 500:s cmode*:*: {
if ($me isop $$4) {
scon $$3 mode $$4 $$5-
.notice $nick Changed channel mode to $$5-
halt
}
} where the /ctcp command is slightely different (note is s cmode and not cmode). The command would be: /ctcp <bot_nick> s cmode %Network.var #chan <modes>But still nothing.. Thanks very much for the help, Zyzzy.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
You send: /ctcp bot_nick cmode dalnet #channel modesThe bot has this: ctcp 500:cmode *:*:{
scid $$n-cid($2)
if $me isop $3 { mode $3 $$4- }
scid -r
.notice $nick Changed channel mode to $$4-
halt
}
alias n-cid var %a | scon -a if $1 == $!network $eval({ var %a = $cid },0) | return %a
alias s-cid var %a | scon -a if $1 == $!server $eval({ var %a = $cid },0) | return %a
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
For those to work I believe you would need to remove the "$me $+ : $+ " alias getNScon { - var %networks
scon -at1 $(%networks = %networks $network,0) return $findtok(%networks, $1, 1, 32)
}
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Oh, so this looks up the $cid of the network and uses it? and...What does this mean? scid $$n-cid($2)
if $me isop $3 { mode $3 $$4- }
scid -r (sorry for all the questions, but im a lil confused lol  the scid $$n-cid - what does it do? Thanks a lot, Zyzzy.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
scid $$n-cid($2) [color:brown]| ; Switches the script to whatever CID is connected to $2
| ; in the example, $2 would be dalnet[/color]
if $me isop $3 { mode $3 $$4- } [color:brown]| ; checks if $me (the bot) is opped on $3 (the channel)
| ; and changes modes specified in $4-[/color]
scid -r [color:brown]| ; resets CID, so it can notice you on the correct connection.[/color] See /help /scid" the scid $$n-cid - what does it do?" From my first post: "Here is a simple alias to find the CID of a particular network."  $$n-cid(undernet) finds the CID of a connection to Undernet. $$n-cid(dalnet) finds the CID of a connection to Undernet. The '$$' causes the script to halt if there is no connection to $2 to avoid errors
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Hurray!!  I did some tests and it is working fine untill now! I havent tried all the commands but it seems like they are working!  I want to thank everybody who helped me here!  Thanks a lot! Regards, Zyzzy.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
Indeed. I just looked in my remotes for a similar script from something I'd written to answer someone else's question ages ago. That $me $+ solution obviously had to do with more than just the network names ... and I completely missed that they were still in that scriptlet (corrected now). I should have just typed it up again, instead of copy/pasting.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
|