Simple BRB and Back script -- For mIRC bots

Platform:  mIRC
Published  Jun 21, 2011
Updated  Jun 21, 2011
Simple BRB and Back script for bots.
To make this script work is simple, someone has to say brb and a reason

[16:31] <~Justin> brb I need to get water
[16:31] <&iRobin> » Justin will be right back. Reason: I need to get water. «

[16:31] <~Justin> back
[16:31] <&iRobin> » Justin is back from: I need to get water. «


PS: This is not my script; I kind of edited this.
on *:TEXT:brb*:#:{
if ($2 == $null) {
writeini brb.ini $nick Brb none
writeini brbonoff.ini $nick brb on
msg $chan » $nick will be right back. Reason: none. «
}
else {
writeini brb.ini $nick Brb $2-
writeini brbonoff.ini $nick brb on
msg $chan » $nick will be right back. Reason: $2- $+ . «
}
}
on *:TEXT:back:#:{
if ($readini(brbonoff.ini,$nick,brb) == off) { HALT }
elseif ($readini(brbonoff.ini,$nick,brb) == on) {
msg $chan » $nick is back from: $readini(brb.ini,$nick,Brb) $+ . «
remini brb.ini $nick Brb
writeini brbonoff.ini $nick brb off
}
}

Comments

Sign in to comment.
Xpl0reR   -  Jun 26, 2011
this was a script i used, and Tom- on Swiftirc did for me. exactly the same regex line in the event.
 Respond  
blackvenomm666   -  Jun 21, 2011
ty jethro for that information as im sure you noticed im pretty new to doing any regex haha. so i was not away of that
 Respond  
iProTopia   -  Jun 21, 2011
What a debate lol Ty again for the snippets :)
 Respond  
Jethro   -  Jun 21, 2011
Venom, by using on text regex like you've done, you can drop the parentheses...and you have to know that only $1 will get control codes stripped. $1 equals to $regml(1).
 Respond  
blackvenomm666   -  Jun 21, 2011
i dont remember who originally did it i found it here but i edited it
Code
 
 Respond  
blackvenomm666   -  Jun 21, 2011
true but meh im just saying some people forget haha. i have one of someones that i edited to suit my mood more added some stuff an such and half the time i forget to say back
 Respond  
napa182   -  Jun 21, 2011
then there would be no point in saying back at all =P
 Respond  
blackvenomm666   -  Jun 21, 2011
i mean lets say someone is away but forgets about the bot when they start talking it would auto bring them back soooo like
Code
 




 Respond  
Jethro   -  Jun 21, 2011
Venom, that doesn't seem like a good idea. If you may elaborate, make your point more clearly.
 Respond  
blackvenomm666   -  Jun 21, 2011
or an on text where if the persons == the away person it auto says they are back
 Respond  
Jethro   -  Jun 21, 2011
Oh yeah there is a probability that he or she will never say back...lol

But it's an easy fix to include a part, quit event to unset the variables! I don't reckon the departed people will come back and say back again...that just doesn't make sense.

Last but not least, change $nick to $wildsite in case he or she changes their nickname.
 Respond  
napa182   -  Jun 21, 2011
yes to keep it simple as so the author can understand you can do as an example:
I still wouldn't go with global vars cuz you will tend to get people setting them selvs brb an never saying back then you will have unwanted global vars
Code
 
 Respond  
Jethro   -  Jun 21, 2011
blackvenomm666, the use of
Code
 
eliminates the else condition.
 Respond  
blackvenomm666   -  Jun 21, 2011
<<doesnt even understand jethro_'s
 Respond  
blackvenomm666   -  Jun 21, 2011
Code
 

 Respond  
Jethro   -  Jun 21, 2011
Well ok, for starters, this:
if ($2 == $null) {
writeini brb.ini $nick Brb none
writeini brbonoff.ini $nick brb on
msg $chan » $nick will be right back. Reason: none. «
}
else {
writeini brb.ini $nick Brb $2-
writeini brbonoff.ini $nick brb on
msg $chan » $nick will be right back. Reason: $2- $+ . «
}
}
can just be:
Code
 
This is the crucial part that needs correcting to get rid of the redundancy.
 Respond  
Jethro   -  Jun 21, 2011
lol napa, I didn't expect them to, but it's served as a demonstration for those who can have a grasp at it. I love to get feedback from people from all walks of life.
 Respond  
napa182   -  Jun 21, 2011
lol Jethro_ like they are going to understand that....
maybe keep it simple for them to understand what you did.
 Respond  
Jethro   -  Jun 21, 2011
Well, that is a waste of INI for a simple task like this. This script should have used a local variable, and that's more than enough. Here is my version:
Code
 
 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.