mIRC Home    About    Download    Register    News    Help

Print Thread
#242232 26/06/13 06:33 PM
Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
I'm working on an 'on text' command that when someone types in !connect, a bot will automatically join that channel. I have this at the moment but it doesn't seem to be working:

Code:
on *:text:!connect:#:{
  /join # $+ $nick
} 


It's probably just a stupid mistake or I've done it completely wrong, but any help would be greatly appreciated.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Join what channel? What do you mean by 'that channel' ?

Will the user specify a channel? Ie:

"!connect #channel"

??

Or something else?

Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
I want the bot to join the channel of the person who types in !connect. If that's possible.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
That person might be in ten different channels, do you want it to join all of them?

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You can use ! - no problem. His original script was fine syntactically, it's just the logic that's wrong.

Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
The bot is going to be used on Twitch, so all I want the bot to do is to connect to the channel that has the same name as the user who posts !connect.

Last edited by GamingTom; 26/06/13 07:06 PM.
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
In that case, your original script is almost right:

Code:
on *:text:!connect:#:{
  /join $chr(35) $+ $nick
}


The reason your original script didn't work is because # is evaluated to the current channel, just like $chan. So you need to use $chr(35) or $(#,0) or $eval(#,0), whichever you prefer smile

Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
Hmm, that still doesn't work... I'm using my account and am typing in !connect on the bot's twitch account but the bot still doesn't join the channel '#gamingtom'. Any idea?

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Do you get any messages in your status or channel windows? Are you typing this on a channel that both you and the bot are on? You need to type it in a different instance of mIRC to what the script is running in.

Try changing it to this:

Code:
on *:text:!connect:#:{
  echo -s /join $chr(35) $+ $nick
}


And see if anything is echoed in your status window. If so, what does it say?

Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
I tried that new script but nothing changed. Nothing echoes and on the last one nothing was said in the status or channel windows except me saying !connect. The bot is also in the twitch channel I am typing !connect in...

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Type /remote on in your status window and make sure you paste that script into a new remote script file.

I think another on text event above this one in your script file is blocking it.

Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
Here is my remote file: http://pastebin.com/eRspW71U and also, my remotes are definitely on as I'm using other commands. The script I'm having trouble on is right at the bottom. Is it better to have multiple remote files? Does it make a different?

Last edited by GamingTom; 26/06/13 07:24 PM.
Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
Okay, I've added the script to a new remote script file and it doesn't seem to be working, I think it might just not be possible.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
There's nothing wrong with the script, so I presume it's down to the way the IRC network is configured. Can you get the bot to join the channel if you type it manually?

/join #<nick>

Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
Well, it seems to be working now! thanks a lot for your help! laugh

Last edited by GamingTom; 26/06/13 08:02 PM.
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
No probs smile


Link Copied to Clipboard