action reply

By Epic on May 11, 2011

Saw a friend one day who had a reply to when ppl slapped him or did any other action, so i made 1 similar to it

If you know away to make it excluse things like $ip $findfile or andthing $ related, please let me know :p?

includes simple anti flood and a timer to make it not spam back, i know could be shorter but im having brain roadblocks lately =\

Edit: change the .timer thanks to ford jeth jaytea and napa for their various helpful posts

on *:action:*:#:{
  if ($me isin $1-) && (!%fl) {
    inc -u10 %fl
    .timer 1 2 describe # $replace($1-,$me,$nick,$chr(36),$+($chr(36),!),$chr(37),$+($str($chr(2),2),$chr(37)),|,$+($str($chr(2),2),|))
  }
}

Comments

Sign in to comment.
jaytea   -  May 14, 2011

@Epic just change:

.timer 1 2 describe # $replace($1-,$me,%nick)

To:

  .timer 1 2 describe # $replace($1-,$me,$nick,$chr(36),$+($chr(36),!),$chr(37),$+($str($chr(2),2),$chr(37)),|,$+($str($chr(2),2),|))

careful Ford :P we can easily circumvent this with evaluation brackets, for example $1- = '[ [ $identifier ] ]' becomes '[ [ $!identifier ] ]' and so '$identifier' still evaluates when the timer fires.

the $encode/$decode method is tried and true, but causes problems for users who have $decode locked. also, MIME type encoding inflates the string by at least a third of its original length (length in UTF-8, that is). it has its advantage, in that it doesn't require the addition of custom aliases; but the right custom alias would make for a much more optimal method of escaping code.

here is a relatively recent discussion on the issue, i have a small snippet at the end there which is an attempt to advance the methodology regarding escaping strings

 Respond  
Jethro   -  May 12, 2011

napa's hit the spot: just dump the timer. I see that you've updated your code with the $chr(36) being halted. Now if someone said something /me gives Epic $5 bucks, it'd be ignored. Why the trouble then?

Just do this based upon your current code:

on *:action:*:#:{
  if ($me isin $1-) && (!%fl) { 
    inc -u10 %fl 
    describe # $replace($1-,$me,$nick)
  }
}

BUT if you really opt for a 2-second delay, you can use the play command like this instead of a timer and worry about expoits:

on *:action:*:#:{
  if ($me isin $1-) && (!%fl) { 
    inc -u10 %fl 
    write -c $event describe # $replace($1-,$me,$nick)
    .play -c # $event 2000
  }
}
 Respond  
napa182   -  May 12, 2011

just get rid of the timer as FordLawnmower said. No real need for it anyways.

 Respond  
Jethro   -  May 11, 2011

I think this will stop the exploit:

on $*:action:$(/( |^)\Q $+ $replacecs($me,\E,\E\\E\Q) $+ \E( |$)/Si):#:{
  if (!%f) { 
    inc -u10 %f 
    .timer 1 2 describe # $replace($1-,$!decode( $encode($me,m) ,m),$nick) 
  }
}
 Respond  
Epic   -  May 11, 2011

yeh jethro i tried yours exactly and it still did it :s and yeah true ford, didnt even consider that was why, but i edited the script simply to not answr if $ was init :3

 Respond  
Jethro   -  May 11, 2011

Let me know if the regex option gets exploited...cause it'll only trigger on $me the way it is in a sentence.

 Respond  
FordLawnmower   -  May 11, 2011

@Epic just change:

.timer 1 2 describe # $replace($1-,$me,%nick)

To:

  .timer 1 2 describe # $replace($1-,$me,$nick,$chr(36),$+($chr(36),!),$chr(37),$+($str($chr(2),2),$chr(37)),|,$+($str($chr(2),2),|))

Or remove the timer. The timer is causing the evaluation.

Edited

 Respond  
Epic   -  May 11, 2011

thanks il try it :)

 Respond  
Jethro   -  May 11, 2011

You should do it with regex then:

on $*:action:$(/( |^)\Q $+ $replacecs($me,\E,\E\\E\Q) $+ \E( |$)/Si):#:{
  if (!%f) { inc -u10 %f | .timer 1 2 describe # $replace($1-,$me,$nick) }
}
 Respond  
Epic   -  May 11, 2011

idk i thought it failed for me on that, but i probably missed something, but hey jethro_ you got any clue how i could add anti expliot on this because if you can see, if ppl did "action: $me $ip" would show ip and if they did like "$findfile(C: , , quit irc noob)" itd do that :s

 Respond  
Jethro   -  May 11, 2011

You don't need to set the local var for %nick = $nick
Simply use: .timer 1 2 describe # $replace($1-,$me,$nick)
will get the job done just fine. Why go the extra mile?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.