!8ball revisited
mIRC Code
+ 0 likes
Please Register to submit score.
| Average Score | 0.0 (of 0 scores) |
| Date Added | Sep 22, 2009 |
| Last Updated | Sep 22, 2009 |
| Tags | 8ball bot channel fun |
Description
Well here it is. 8ball refined!
This will automatically create the needed text file to read from plus put some default entries in it for you when its loaded.
Triggers are :
!8ball <question>
!add8ball <reply to add>
!del8ball <reply to delete>
!8ball is fairly obvious ask a question get a reply.
!add8ball allows people with the proper permissions add replies directly to the .txt file for future use
!del8ball allows people with the proper permissions to delete replies from the .txt
for bot owners theres Nick protection of sorts. replace "PUT YOUR NICK HERE" in this line :
if (PUT YOUR NICK HERE isin $2-) { $_jibb($chan) } with your own nick.
Not sure im totally done with this one but enjoy for now. As always im open to ideas and suggestions.
This will automatically create the needed text file to read from plus put some default entries in it for you when its loaded.
Triggers are :
!8ball <question>
!add8ball <reply to add>
!del8ball <reply to delete>
!8ball is fairly obvious ask a question get a reply.
!add8ball allows people with the proper permissions add replies directly to the .txt file for future use
!del8ball allows people with the proper permissions to delete replies from the .txt
for bot owners theres Nick protection of sorts. replace "PUT YOUR NICK HERE" in this line :
if (PUT YOUR NICK HERE isin $2-) { $_jibb($chan) } with your own nick.
Not sure im totally done with this one but enjoy for now. As always im open to ideas and suggestions.
mIRC Snippet:
!8ball revisited
Posted on Sep 22, 2009 3:27 am
Posted on Sep 22, 2009 3:27 am
* /msg: insufficient parameters (line 89, 8ball)
-
89'th line : else { msg $chan %8ball }
-
89'th line : else { msg $chan %8ball }
mIRC Snippet:
!8ball revisited
Posted on Sep 22, 2009 9:04 am
Posted on Sep 22, 2009 9:04 am
did you replace "PUT NICK HERE" with your nick?
mIRC Snippet:
!8ball revisited
Posted on Sep 22, 2009 3:28 pm
Posted on Sep 22, 2009 3:28 pm
| Code: |
| if ($regex($nick($chan,$nick).pnick,[&~])) { |
mIRC Snippet:
!8ball revisited
Posted on Sep 22, 2009 4:51 pm
Posted on Sep 22, 2009 4:51 pm
Why use the regex engine when you can do:
this will exclude regular and voiced users and make it available to the rest of usermodes.
| Code: |
| if ($nick(#,$nick,a,rv).pnick) { |
mIRC Snippet:
!8ball revisited
Posted on Sep 24, 2009 10:09 pm
Posted on Sep 24, 2009 10:09 pm
@ sunslayer yea ur right it wont work on all nets was coded on unrealircd so should work on any net using that or similar.
@ Jethro_ i only used it because it was something i had recently learned, either way will work.
and i wanted to restrict it to only & and up for the delete entry and add entry parts for personal reasons. you can easily change it tho to include other access levels
@ Jethro_ i only used it because it was something i had recently learned, either way will work.
and i wanted to restrict it to only & and up for the delete entry and add entry parts for personal reasons. you can easily change it tho to include other access levels
mIRC Snippet:
!8ball revisited
Posted on Sep 24, 2009 11:30 pm
Posted on Sep 24, 2009 11:30 pm
Yes, that's good for every one of us to learn something new, but then the question remains, why go the extra mile when you can do something in a shorter fashion? We should always find efficient, clean and non-redundant ways to go about scripting.
mIRC Snippet:
!8ball revisited
Posted on Sep 25, 2009 1:17 pm
Posted on Sep 25, 2009 1:17 pm
| Code: |
| $nick(#,$nick,a,rv).pnick |
| Quote: |
| <Jethro_> this will exclude regular and voiced users and make it available to the rest of usermodes |
No need for the .pnick propery. This $nick(#,$nick,a,rv) will actually
evaluate false for ALL users with voice even if they have a higher mode.
To get the results you want use:
| Code: |
| $nick(#,$nick,~&@%) |
mIRC Snippet:
!8ball revisited
Posted on Sep 25, 2009 1:25 pm
Posted on Sep 25, 2009 1:25 pm
gooshie, while I agree the .pnick property is needless, I have to disagree with you regarding my example. If you test it, it works exactly the same per your suggestion:
If I'm incorrect, please give me an explanation why it'll be evaluated falsely?
| Code: |
| on event { if $nick(#,$nick,a,rv) { echo -a true } } |
mIRC Snippet:
!8ball revisited
Posted on Sep 25, 2009 1:50 pm
Posted on Sep 25, 2009 1:50 pm
Jethro_
Same number of keystrokes different results.
Test it for yourself. Make a random room so
you have ops and then voice yourself and then:
| Code: |
| $nick(#,$nick,a,rv) != $nick(#,$nick,~&@%) |
Same number of keystrokes different results.
Test it for yourself. Make a random room so
you have ops and then voice yourself and then:
| Code: |
| //echo ==> $nick(#,$me,a,rv) != $nick(#,$me,~&@%) |
mIRC Snippet:
!8ball revisited
Posted on Sep 25, 2009 2:23 pm
Posted on Sep 25, 2009 2:23 pm
Ok, I see what you mean now. Thanks for the demonstration, gooshie.
mIRC Snippet:
!8ball revisited
Posted on Sep 25, 2009 5:28 pm
Posted on Sep 25, 2009 5:28 pm
Glad to help Jethro_
mIRC Snippet:
!8ball revisited
Posted on Oct 12, 2009 8:43 am
Posted on Oct 12, 2009 8:43 am
Needs an if $exists for the file on load event.
I only put enough file writes to demonstrate.
Eliminated set/global variables.
Eliminated _jibb alias.
Simplified while loops.
Changed !commands so !8ball* could
be used in on TEXT event filter.
I only put enough file writes to demonstrate.
Eliminated set/global variables.
Eliminated _jibb alias.
Simplified while loops.
Changed !commands so !8ball* could
be used in on TEXT event filter.
| Code: |
| on *:TEXT:!8ball*:#: { var %i 1,%x,%f $scriptdir8ball.txt if $1 == !8balladd { if $nick(#,$nick,~&@) { if $2 { while $read(%f,%i) { if $2- == $v1 { %x = 1 } inc %i } if %x { msg # $+(,",$2-,",) has already been added. } else { write %f $2- | msg # $+(,",$2-,",) has been added to the reply list. } } else { msg # No Reply Was Stated. } } else { msg # access denied } } elseif $1 == !8balldel { if $nick(#,$nick,~&@) { if $2 { while $read(%f,%i) { if $2- == $v1 { %x = %i } inc %i } if %x { write -dl $+ %x %f | msg # $+(,",$2-,",) has been deleted. } else { msg # No Matching Entries Found } } else { msg # Please Enter Something To Delete. } } else { msg # access denied } } elseif $1 == !8ball { if $2 { if $me isin $2- { goto $r(1,4) :1 | msg # $nick if you dont stop picking on $me I'm gonna kick you in the nutz! | halt :2 | msg # I'm sorry $nick he's not here right now can I help you? | halt :3 | msg # Flattery will get you nowhere $nick $+ . | halt :4 | msg # $nick $+ , I'll lick you for 50 cents. } else { msg # $read(%f) } } else { msg # Please Enter A Question Silly } } } on *:LOAD: { echo -a JibbaNet 8ball v1.0 Loaded var %f $scriptdir8ball.txt if !$exists(%f) { echo -a Default Replies written to: %f %f = write %f %f Ask again later %f Not a chance %f As I see it, yes %f Cannot predict now %f Don't count on it %f It is certain } } |
mIRC Snippet:
!8ball revisited
Posted on Nov 26, 2009 12:15 am
Posted on Nov 26, 2009 12:15 am
nice. been a while since i logged in here :D i like what u did thanks for the tips.
mIRC Snippet:
!8ball revisited
Posted on Jan 29, 2010 5:42 pm
Posted on Jan 29, 2010 5:42 pm
I want script to work with me also.... how i do that?






