Yeah you can totally switch back and forth between scon or scid.
Also consider that you can create what I call a switch. As in to turn on or off. You can set a variable, hash table entry, ini file entry, etc. that says you are in "#chan1" of "network1" so when it comes time to check, you just check your variable, hash table entry, etc.
I would do something like this if I saw that I would be accessing this information repeatedly. You would have to use the events: join, part, disconnect, exit and possibly others.
Anytime you connect/join you want to set that variable that matches the network and channel. (switch it to on) Whenever you part/disconnect you would want to remove the variable. (switch it off) You may find other reasons/events that you need to turn the switch on or off.
on !*:join:#:{
if ($network = Network) && (# = Chan1) set %ch_chk $true
}
on !*:part:#:{
if ($network = Network) && (# = CHan1) unset %ch_chk
}
on *:text:*:#:{
if (%ch_chk) {
;You are on correct network and channel
}
}
Of course it is up to you whether no variable means it is off or on. I use both ways depending on the situation.
I may have understood you wrong.
If you want to check if another mIRC is connected to a channel you are on you can send it a message and have it respond to you. You can use a silent /notice and have it only respond if it's you or you are part of a user group.
- Send it a message
- set a variable that says you are doing this check
- set a timer that will trigger the alias to decide how to handle the response (if any).
- have an event waiting for a response (notice, text, ctcpreply)
On the other script you would look for the exact code coming from you and be ready to send back a reply.
Basic On/Off switch:
When you get the reply you would unset the variable. This lets you know something happened. If nothing had happened the variable would still be set. So when the alias triggers it will see the variable is gone and know the script responded to you. You can set a variable letting you know that script is connected. Or maybe you decide to not set a variable when you start, and only setting it if the other bot responds.
Communication:
You can also use this variable to store any data your other bot sends to you. For instance if you request the information that bot had on a nick, it would send back the data in an event somewhere in the $1- and you can save it to that variable.
Rationale: Your script is already working with this variable and looking for it so use it.