mIRC Home    About    Download    Register    News    Help

Print Thread
#241903 02/06/13 03:47 PM
G
GamingTom
GamingTom
G
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.

#241905 02/06/13 10:16 PM
D
Deega
Deega
D
See
/help /auser
/help /guser


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


#241906 02/06/13 11:00 PM
G
GamingTom
GamingTom
G
That didn't seem to work. If you have any other ideas, that would be great.

#241907 02/06/13 11:21 PM
D
Deega
Deega
D
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.
#241915 03/06/13 06:10 AM
G
GamingTom
GamingTom
G
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.
#241919 03/06/13 03:30 PM
D
Deega
Deega
D
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.

#241921 03/06/13 04:05 PM
G
GamingTom
GamingTom
G
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?

#241922 03/06/13 04:14 PM
D
Deega
Deega
D
Sure, you can remove the $nick(#,$2) check if you want.

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


#241923 03/06/13 04:18 PM
G
GamingTom
GamingTom
G
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.
#241924 03/06/13 04:24 PM
D
Deega
Deega
D
Code:
on *:text:!ulevel & &:#channel:{
  if ($nick == YOURnick) { auser $3 $2 }
  msg # $2 has been set to level $3
}

#241925 03/06/13 04:40 PM
G
GamingTom
GamingTom
G
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!

#241926 03/06/13 05:03 PM
D
Deega
Deega
D
NP smile


Link Copied to Clipboard