on op:text:!add network*:*:{
if !$3 {
.hadd -m Networks $network $server
}
elseif !$4 { .msg $nick Usage !add network <network> <server> }
else {
.hinc -m Networks $3
.hadd -m Networks $+($3,.,$hget(Networks,$3)) $4
.msg $nick Network $3 with server address $4 has been added
}
}
on op:text:!add room*:*:{
if $target == $chan {
if !$3 { .hadd -m $network $chan }
else {
.hadd -m $iif(!$4,$network,$3) $iif(!$4,$3,$4)
}
}
elseif !$3 {
.msg $nick Usage: !add room (network) <channel>
.msg $nick (network) is optional
}
else {
.hadd -m $iif(!$4,$network,$3) $iif(!$4,$3,$4)
}
}
So far, so good, what I need now is
A) a method to check if the network used in the second code is in the hash table from the first code.
If it isn't there and I'm connected to that network, then the information from $network & $server is to be added to the Networks hash table automatically.
If it isn't there & I'm not connected to the network, then the person that entered the information is to be asked for a server address for that network.
B) If I'm not connected to the network, as referenced in A, then I'm to connect to that network and the channel specified in the second code.
C) If I am already connected to that network, then I need to check if I'm in the room specified on that network.
Hope this all makes sense and that someone can help me with this conundrum.