mIRC Home    About    Download    Register    News    Help

Print Thread
#241903 02/06/13 03:47 PM
Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
I am currently working on a Twitch bot and I'm looking for a way that if I type something like '!ulevel [user nick] [user level]' into the twitch chat it will change the person with that nickname to the user level specified. I don't know if this will be possible but if so I would greatly appreciate some help.

Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
See
/help /auser
/help /guser


Code:
on *:text:!ulevel & &:#channel:{
  if ($nick == YOURnick) && ($nick(#,$2)) { auser $2- }
}


Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
That didn't seem to work. If you have any other ideas, that would be great.

Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Did you change "#channel" to your correct channel name?

And "YOURnick" to your nick? smile

Last edited by Deega; 02/06/13 11:22 PM.
Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
Yes I did, what is it I'm meant to type to get the command working? And I also want the command to work on any nickname, not just mine so if this is possible, that would be great.

Last edited by GamingTom; 03/06/13 06:49 AM.
Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Originally Posted By: GamingTom
Yes I did, what is it I'm meant to type to get the command working?
You type what you asked for. !ulevel user level


I did make a mistake in the script though, sorry.
Here's the correct line.
Code:
  if ($nick == YOURnick) && ($nick(#,$2)) { auser $3 $2 }



Originally Posted By: GamingTom
And I also want the command to work on any nickname, not just mine so if this is possible, that would be great.
"($nick == YOURnick)" checks the user who posted the command or anyone could use the command. That's why "YOURnick" needs to be YOU (not your bots nick)
"($nick(#,$2))" Simply a check that there is a user in the channel with the supplied name.


Note: You can not trigger this script if it is running on your own client. It needs to be running on your bot.

Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
Thanks! That seems to be working now. One last thing would be great though, is it possible to you that commands on someone who isn't in the channel? So lets say 'test' isn't in at the moment but I want to change his user level. Is there a way to do !ulevel test 5?

Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Sure, you can remove the $nick(#,$2) check if you want.

Code:
if ($nick == YOURnick) { auser $3 $2 }


Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
Thank you so much for your help! I greatly appreciate your help. Once again, thanks.

And if you're up for helping my again, is it possible to add in somewhere to make the bot say "<User> has been set to level <level>"?

Last edited by GamingTom; 03/06/13 04:23 PM.
Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Code:
on *:text:!ulevel & &:#channel:{
  if ($nick == YOURnick) { auser $3 $2 }
  msg # $2 has been set to level $3
}

Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
I tried /say instead of msg #, but other than that, that is basically what I had. But that is all I needed! Thanks for your quick responses and help!

Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
NP smile


Link Copied to Clipboard