mIRC Homepage
Posted By: Nordy [Twitch] !love command - 04/10/15 03:14 PM
Hey world i am new to mIRC. Is someone out there who could help me to understand how the !love command from Moobot exactly works? Like how can i create a "$user variable" just for the streamer and just for the bot. Thanks a lot for the help. Best regards.
Posted By: Nillen Re: [Twitch] !love command - 04/10/15 07:28 PM
Your explanation is insufficient, would you mind trying again?
What is the trigger, does it require any parameters, is it conditional at all, what's the expected result?
What is your definition of "$user variable"?
Posted By: Nordy Re: [Twitch] !love command - 05/10/15 12:48 PM
i used one of your codes
Code:
 on *:text:!love &:#: { msg # There's $rand(1,100) % <3 between $nick and $2 . 


from here:
Html:
 https://forums.mirc.com/ubbthreads.php/topics/249996/Nightbots_@touser@ 



but now i want to make a custom response for the streamer and the channel bot with the same command like:



if $2 is "streamer" =

The love $nick has for our beloved Dear Leader $2 transcends all <3 .



if $2 is "bot" =

Silly organic, bots cannot know love BibleThump


I hope you understand what i mean.
Posted By: Nillen Re: [Twitch] !love command - 05/10/15 01:31 PM
Fair enough, you're looking for something like this I take it? This is a hardcoded static version, you can create something more dynamic in the future if you learn more about variables and values in programming.

Code:
on *:text:!love &:#: { 
var %user $$2
var %rng $rand(1,100)
var %streamer $remove(#,$chr(35)) 
if (%user == $me) var %message Silly organic, bots cannot know love BibleThump
elseif (%user == %streamer) var %message The love $nick has for our beloved Dear Leader %user transcends all <3 .
else var %message There's %rng $chr(37) <3 between $nick and %user $+ .
msg # %message
}
Posted By: Nordy Re: [Twitch] !love command - 05/10/15 02:25 PM
Yeah awesome thx! grin

One last question is there a way to make it like that?

"Bot": There's 25 % <3 between "user" and "Streamer".

"Bot": There's 43 % <3 between "user" and "Streamer".

"Bot": The love "user" has for our beloved Dear Leader "Streamer" transcends all <3 .

best regards
Posted By: Nillen Re: [Twitch] !love command - 05/10/15 04:07 PM
elseif (%user == %streamer) var %message The love $nick has for our beloved Dear Leader %user transcends all <3 .

Change the message in that line to what you want.
Posted By: Nordy Re: [Twitch] !love command - 05/10/15 04:26 PM
Code:
 elseif (%user == %streamer) var %message $read(testtest.txt) 


testtest.txt
Code:
The love $nick has for our beloved Dear Leader %user transcends all <3 .
There's 1 % <3 between $nick and %user .
There's 44 % <3 between $nick and %user .
There's 99 % <3 between $nick and %user .
There's 69 % <3 between $nick and %user .
There's 25 % <3 between $nick and %user .
There's 3 % <3 between $nick and %user .
There's 9 % <3 between $nick and %user .
There's 50 % <3 between $nick and %user .
There's 33 % <3 between $nick and %user .
There's 70 % <3 between $nick and %user . 


i mean like getting multiple anwsers like how i do it atm :-D
Posted By: Nillen Re: [Twitch] !love command - 05/10/15 08:03 PM
From what it looks like, you have a bunch of unneccesary lines in a textfile. Most lines just reappear with changing values that can be set dynamically instead.

Let's say the chance is 1 in 10 to get the trancends all message, in that case it would look something like this.
Code:
on *:text:!love &:#: { 
var %user $$2
var %rng $rand(1,100)
var %streamer $remove(#,$chr(35)) 
if (%user == $me) var %message Silly organic, bots cannot know love BibleThump
elseif (%user == %streamer) var %message The love $nick has for our beloved Dear Leader %user transcends all <3 .
else { 
var %chance 10
var %chance_rng $rand(1,%chance)
if (%chance_rng == %chance) var %message The love $nick has for our beloved Dear Leader %user transcends all
else var %message There's %rng $chr(37) <3 between $nick and %user $+ .
}
msg # %message
}
© mIRC Discussion Forums