mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2014
Posts: 83
H
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
I have a script bot that shares cryptocurrency with people in the channel its in... but at the moment, its sending randomly to even people who havent talked for a day or two. I want it to only send to those who are active...

This is the code as of now:
Code:
ON *:TEXT:*tipped HYPStorm*:##hyperstake:{ 
  if ($nick == Matylda) {
    timer 1 2 msg ##hyperstake Its looking a like a storms a brewing... (courtesy of $1 )
    timer 1 4 msg ##hyperstake PREPARE FOR A SOAKING 
    timer 1 7 msg ##hyperstake !rain $4 10 
  }
}


the $4 is the amount that was tipped to share and the 10 is how many people to split.

if this could look for active users. it wouldnt need the 10 and would just split the tip between the active users.

Is there anyway to do that?

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Code:
alias safe return $!decode( $encode($1,m) ,m)

ON *:TEXT:*tipped HYPStorm*:##hyperstake:{ 
  if ($nick == Matylda) {
    timer 1 2 msg ##hyperstake Its looking a like a storms a brewing... (courtesy of $safe($1) $!+ )
    timer 1 4 msg ##hyperstake PREPARE FOR A SOAKING 
    timer 1 7 msg ##hyperstake !rain $safe($4) 10 
  }
}


Passing unsanitized content to a timer can compromise your system. http://en.wikichip.org/wiki/mirc/msl_injection

Joined: Sep 2014
Posts: 83
H
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
so that code should work? like if I tipped it 100 to share it would evenly distribute them to whoever is active in the channel?

and the timers are being taken off cause it wont need them anymore

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
The script has nothing about being active.

Joined: Sep 2014
Posts: 83
H
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
smirk how do i get it to detect active users and send to them?

Last edited by HappyFappy; 21/10/14 01:57 AM.
Joined: Sep 2014
Posts: 83
H
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
Still in need frown

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
What does it mean to be active in the channel to you? And how will the bot know who is active? You need to have an idea before you make a script. Please do share your ideas and we can help you further.

For instance: "Whenever someone writes something, they get added to a list somewhere. If they leave the channel or don't write anything for 15 minutes, they get kicked off that list."
is what we want to see, so we know exactly what it is you want.

Also, there's really no need to post again after 24 hours has passed, this is a slow-moving forum, so there's no fear that your post is buried.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Sep 2014
Posts: 83
H
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
Quote:
For instance: "Whenever someone writes something, they get added to a list somewhere. If they leave the channel or don't write anything for 15 minutes, they get kicked off that list."
is what we want to see, so we know exactly what it is you want.


thats exactly what i need lol

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Then let us know what idea you have to begin with.
Now, let's get started on working on this script.

Code:
on *:text:*:#channel: { 
write activeusers.txt $nick 
;We've written the user to the list, how do we make sure he's not written there twice and that he gets removed if he doesn't say anything or leaves the channel?
;Hint - /help timers - /help if then else - /help on part
}


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard