mIRC Home    About    Download    Register    News    Help

Print Thread
H
HappyFappy
HappyFappy
H
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,330
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,330
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

H
HappyFappy
HappyFappy
H
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,330
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,330
The script has nothing about being active.

H
HappyFappy
HappyFappy
H
smirk how do i get it to detect active users and send to them?

Last edited by HappyFappy; 21/10/14 01:57 AM.
H
HappyFappy
HappyFappy
H
Still in need frown

Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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.

H
HappyFappy
HappyFappy
H
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: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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
}


Link Copied to Clipboard