mIRC Home    About    Download    Register    News    Help

Page 1 of 2 1 2 >
Topic Options
#157026 - 21/08/06 12:54 PM request: advanced script to act as a "bot"...
gomp Offline
Fjord artisan

Registered: 14/06/04
Posts: 243
Loc: Norway.
...a "bot", for quotes, and I might adapt the script to also function as a mantra-quoter, in #buddhism, etcetera..

Hey! I am asking a really big favour here. grin

I have searched the net many times for this, and can only find no-usable-for my purpose stuff, of stuff for eggdrops.
Or scripts I cannot get to work.

So the thing is.

I got like Hundreds of lines of personal written “one liners” in a text file. I edit all the time via the F8 key. (Opening a notepad by the /run command.)

If I put all the “quotes”, all neatly in order, line by line, in a “quotes.txt” in the mIRC folder, …

Like:

1 "Everything can contain nothing.. but nothing cannot contain everything.. Thus, nothing becomes, what it already is.."
2 "We need no religion, as we are; A legion!"
3 "The Truth is relative to its context."
4 "Never doubt your doubts!"
5 "I neither agree nor dis-agree, I keep open, ... !"
… So on …

Then if anyone wanted to display a random quote, in a dead silent channel E.g.
One could type !quote , either in a channel or in a ‘personal-message too me’.
Subsequently triggering; <my-nick> “random Quote” …

And if anyone got the time and find pleasure in doing this for me. (And others who might like it?)
I would also like for “me acting as a bot”, to be able to do this:

If someone type !addquote “the-quote-they-want-to-add”, to me in personal-message, or in main chat.
(Either it is their own, or by others.)
Then it would be added to “quotes.txt”. (with the newest number) [Which I 'of course' then could edit with easy ever day.]

To protect against abuse, it would be cool to be able to “ban” certain nicknames, by the right click menu. From adding any quotes. (Then "ignoring" from that nickname until I delete it from a list, of some kind or how one may do it?) : )

Also, there should be possible to make it exclude, or ONLY include certain channels.

So, if I imagine having this thus far, I can type !quote, and other can type !quote, to get me to say a “random quote” … so what came to mind then, is that there should be a delay to how many “ 'random' quotes” I will answer in so many minutes. Say ‘max one’; then a random delay with in 10 - 90minutes, or so? (Side note: It would be nice to have the delay 'not be relevant' in the personal-message windows, but unlimited there?)

An other function that would be neat, would be; !quote “number” ..
Say all the lines in the quote.txt get a number on adding, or when I type manually by the F8, adding a new to the .txt. wink

So one could use: !quote “number” to display a selected "One liners."


And, even an other function that would be nice to have:

!quotes Which would make me say: "there is XXX number of quotes in the record!" or something like that.


I imagine it done to test for ideas once again:

I and others, can use: !quote to display a quote, (and it is randomly delayed so no spamming should occur.)
I and others, can use: !quote “number” to display a selected One liner.
I and others, can use !quotes, to see how many quotes there is in the .txt


I and others, can use: !addquote “quote”, to add a quote.
I can right-click on the names of anyone I want to not be ale to use the !addquote feature, and “ban” them from ever doing that with that nick. (so that I still see what the nick say, but won't reply to any off the commands, but the !quote, and !quote "number".)

Maybe even be able to "ban" certain nicks from using any feuture, if they abuse.

If I wanted to disable the script for certain channels, I could do that to? Maybe by just allowing specified channels? [(Some might be bothered by use of this feature, even though there is so many lines that it won’t get repetitive, .. and is growing ‘each day’. (and the random delay)]

Anyone up for ALL THIS scripting?

(I know very little coding myself.)


I can only be thankful by words, and in spirit, though…
Thank you for reading my request!
And have a fine, fine day! laugh


Edited by gomp (21/08/06 12:57 PM)
_________________________
I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.

Top
#157027 - 21/08/06 01:04 PM Re: request: advanced script to act as a "bot"...
gomp Offline
Fjord artisan

Registered: 14/06/04
Posts: 243
Loc: Norway.
Instead of anyone posting to ask me if I have not already posted this kind of post, Plese see http://forums.mirc.com/s...p;page=0#163545

That thread.. And see how messy it is. (And, been dead for weeks.[no replys])
I will not abandon that thread, but now check both that and this, as this one is not so messy, and much easier for any person wanting to do all this from scratch.. (Thank everyone helping, BTW.)

smile
_________________________
I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.

Top
#157028 - 21/08/06 06:15 PM Re: request: advanced script to act as a "bot"...
Firestarter Offline
Vogon poet

Registered: 11/01/06
Posts: 108
Loc: The Underworld
Just a thought instead of writing a new bot why not try a windrop (eggdrop for windows) especially if you have found some scripts for tcl. Or maybe a mircstorm bot which is mirc based and you may be able to adapt some part of it to do what you want. The last alternative is to rent a shell account and run a full eggdrop bot which will be online 24/7 (as long as the shell host is running).
mircstorm
windrop

Hope this helps
Fire

Top
#157029 - 21/08/06 07:18 PM Re: request: advanced script to act as a "bot"...
Reaper Offline
Pikka bird

Registered: 17/08/06
Posts: 19
Loc: San Antonio, Texas
_________________________
ReaperIRC
Killgore Computers

Top
#157030 - 21/08/06 11:21 PM Re: request: advanced script to act as a "bot"...
OrionsBelt Offline
Fjord artisan

Registered: 25/04/06
Posts: 464
Loc: Amsterdam, NL
Below is a quote bot script that I created a while ago.
It stores the quotes in a ini file, and stores a lot of additional information.
It wouldn't work for your own nick, but if you load it on a bot, it should work.
The help is a bit limited, but with it, I guess you could make your own version of it, and improve it however you like.

Code:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;Add Quote
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
on *:TEXT:!aquote*:#:{
  if (!$2) { notice $nick Invalid syntax, use: 7!aquote &lt;7Quote&gt; (7!help for all bot commands, 7!quotehelp for all quote commands) | halt }
  else {
    %quote_counter = $calc(%quote_counter + 1)
    set %inifile quotes.ini
    writeini %inifile %quote_counter ID %quote_counter
    writeini %inifile %quote_counter Quote $2-
    writeini %inifile %quote_counter Date $date
    writeini %inifile %quote_counter Time $time
    writeini %inifile %quote_counter Nick $nick
    writeini %inifile %quote_counter Address $address($nick,1)
    writeini %inifile %quote_counter Channel $chan
    writeini %inifile %quote_counter Visible yes
    writeini %inifile %quote_counter RemovedBy N/A
    writeini %inifile %quote_counter RemovedOnDate N/A
    writeini %inifile %quote_counter RemovedonTime N/A
    writeini %inifile %quote_counter RemovedOnChannel N/A
    msg $chan 3Added Quote ( $+ %quote_counter $+ ): 5 $+ $2- $+ 
    unset %inifile
  }
}
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;Read Quote
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
on *:TEXT:!rquote*:#:{
  if (!$2) {
    set %qID $rand(1,%quote_counter)
    if ($readini(quotes.ini, %qID, Visible) == Yes) {
      set %qMSG $readini(quotes.ini, %qID, quote)
      set %qReply 3Random Quote ( $+ %qID of %quote_counter $+ ): 5 $+ %qMSG $+ 
      msg $chan %qReply
    unset %qID | unset %qMSG | unset %qReply | halt }
    else {
      set %qID $rand(1,%quote_counter)
      while ($readini(quotes.ini, %qID, Visible) == No) { set %qID $rand(1,%quote_counter) }
      set %qMSG $readini(quotes.ini, %qID, quote)
      set %qReply 3Random Quote ( $+ %qID of %quote_counter $+ ): 5 $+ %qMSG $+ 
      msg $chan %qReply
    unset %qID | unset %qMSG | unset %qReply | halt }
  }
  elseif ($2 isnum) {
    set %qID $2
    set %qMSG $readini(quotes.ini, %qID, quote)
    if (!%qMSG) {
      set %qID $rand(1,%quote_counter)
      if ($readini(quotes.ini, %qID, Visible) == Yes) {
        set %qMSG $readini(quotes.ini, %qID, quote)
        set %qReply 3Random Quote ( $+ %qID of %quote_counter $+ ): 5 $+ %qMSG $+ 
        msg $chan %qReply
      unset %qID | unset %qMSG | unset %qReply | halt }
      else {
        set %qID $rand(1,%quote_counter)
        while ($readini(quotes.ini, %qID, Visible) == No) { set %qID $rand(1,%quote_counter) }
        set %qMSG $readini(quotes.ini, %qID, quote)
        set %qReply 3Random Quote ( $+ %qID of %quote_counter $+ ): 5 $+ %qMSG $+ 
        msg $chan %qReply
      unset %qID | unset %qMSG | unset %qReply | halt }
    }
    else {
      if ($readini(quotes.ini, %qID, Visible) == Yes) {
        set %qReply 3Quote %qID $+  5 $+ %qMSG $+ 
        msg $chan %qReply
      unset %qID | unset %qMSG | unset %qReply | halt }
      else {
        set %qReply 3Quote ( $+ %qID of %quote_counter $+ ): 5This quote has been removed from the database.
        msg $chan %Qreply
      unset %qID | unset %qMSG | unset %qReply | halt }
    }
  }
}
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;Quote Details
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
on *:TEXT:!qinfo*:#:{
  if (!$2) { notice $nick Invalid syntax, use: 7!qinfo &lt;7Quote ID&gt; | halt }
  if ($2 isnum) {
    set %qID $2
    set %qMSG $readini(quotes.ini, %qID, quote)
    if (!%qMSG) { notice $nick Invalid Quote ID ( $+ $2 $+ ) specified. | unset %qID | unset %qMSG | halt }
    elseif ($readini(quotes.ini, %qID, Visible) == no) {
      notice $nick 3Quote ( $+ %qID of %quote_counter $+ ): 5This quote has been removed from the database.
    notice $nick 3Removed by: 5 $+ $readini(quotes.ini, %qID, RemovedBy) $+  $+ 3, on 05 $+ $readini(quotes.ini, %qID, RemovedOnDate) $+  3( $+ 05 $+ $readini(quotes.ini, %qID, RemovedOnTime) $+  $+ 3) | unset %qID | unset %qMSG | halt }
    else {
      notice $nick 3Quote ( $+ %qID of %quote_counter $+ ): 5 $+ %qMSG $+ 
    notice $nick 3Added by: 5 $+ $readini(quotes.ini, %qID, Nick) $+  $+ 3, on 05 $+ $readini(quotes.ini, %qID, Date) $+  3( $+ 05 $+ $readini(quotes.ini, %qID, Time) $+  $+ 3) | unset %qID | unset %qMSG | halt }
  }
  else { notice $nick Invalid Quote ID ( $+ $2 $+ ) specified. | unset %qID | unset %qMSG | halt }
}
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;Remove Quote
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
on *:TEXT:!dquote*:#:{
  if (!$2) { notice $nick Invalid syntax, use: 7!dquote &lt;7Quote ID&gt; | halt }
  if ($2 isnum) {
    set %qID $2
    set %qMSG $readini(quotes.ini, %qID, quote)
    if (!%qMSG) { notice $nick Invalid Quote ID ( $+ $2 $+ ) specified. | unset %qID | unset %qMSG | halt }
    elseif ($readini(quotes.ini, %qID, Visible) == no) { notice $nick This Quote ID ( $+ $2 $+ ) has already been removed. | unset %qID | unset %qMSG | halt }
    else ($readini(quotes.ini, %qID, Visible) == yes) {
      set %inifile quotes.ini
      writeini %inifile %qID Visible no
      writeini %inifile %qID RemovedBy $nick
      writeini %inifile %qID RemovedOnDate $date
      writeini %inifile %qID RemovedOnTime $time
      writeini %inifile %qID RemovedOnChannel $chan
      msg $chan 3Removed Quote ( $+ %qID $+ )
    unset %inifile | unset %qID | unset %qMSG | halt }
  }
  else { notice $nick Invalid Quote ID ( $+ $2 $+ ) specified. | unset %qID | unset %qMSG | halt }
}
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;Find Quote
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
on *:TEXT:!fquote*:#:{
  if (!$2) { notice $nick Invalid syntax, use: 7!fquote &lt;7match text here&gt; | halt }
  else {
    set %matchtext * $+ $2- $+ *
    set %matchcounter 0
    var %loop = 1 | while (%loop &lt;= %quote_counter) {
      set %quotestring $readini(quotes.ini, %loop, quote)
      if (%matchtext iswm %quotestring) { 
        if ($readini(quotes.ini, %loop, Visible) == yes) { var %matchedID %matchedID %loop $+ $Chr(44)
        set %matchcounter $calc(%matchcounter + 1) }
      unset %quotestring }
    inc %loop }
    if (%matchedID == $null) { msg $chan $nick $+ , I'm sorry, but your search didn't return any results. | unset %matchtext | unset %matchcounter | unset %quotestring | halt }
    else { msg $chan $nick $+ , I found $iif(%matchcounter == 1, 1 match, %matchcounter matches) to your query. The following Quote ID's contain a match with your query: %matchedID type: 7!rquote &lt;7ID&gt; to show the quote. | unset %matchtext | unset %matchcounter | unset %quotestring | halt }
  }
}
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


And yeah, I bet the code could be a lot shorter.
But this way, at least I understand what happens when.

Good luck.

Top
#157031 - 02/09/06 04:00 AM Re: request: advanced script to act as a "bot"...
gomp Offline
Fjord artisan

Registered: 14/06/04
Posts: 243
Loc: Norway.
The above post all are for bots, I do not want this for a eggdrop, as I then just could have downloaded it from any script site. (if i had wanted anything like that)

I know not coding...

So please disregard the above posts, and if you will code all of this for me, just go by the initial post.. (Quoted)

Thanks for trying though... I should have specified that it is totally uninteresting to have anything but what is explained here:

I got to learn scripting, but if someone find pleasure in doing this for me, I got to give it a chance wink


Quote:
...a "bot", for quotes, and I might adapt the script to also function as a mantra-quoter, in #buddhism, etcetera..

Hey! I am asking a really big favour here. grin

I have searched the net many times for this, and can only find no-usable-for my purpose stuff, of stuff for eggdrops.
Or scripts I cannot get to work.

So the thing is.

I got like Hundreds of lines of personal written “one liners” in a text file. I edit all the time via the F8 key. (Opening a notepad by the /run command.)

If I put all the “quotes”, all neatly in order, line by line, in a “quotes.txt” in the mIRC folder, …

Like:

1 "Everything can contain nothing.. but nothing cannot contain everything.. Thus, nothing becomes, what it already is.."
2 "We need no religion, as we are; A legion!"
3 "The Truth is relative to its context."
4 "Never doubt your doubts!"
5 "I neither agree nor dis-agree, I keep open, ... !"
… So on …

Then if anyone wanted to display a random quote, in a dead silent channel E.g.
One could type !quote , either in a channel or in a ‘personal-message too me’.
Subsequently triggering; <my-nick> “random Quote” …

And if anyone got the time and find pleasure in doing this for me. (And others who might like it?)
I would also like for “me acting as a bot”, to be able to do this:

If someone type !addquote “the-quote-they-want-to-add”, to me in personal-message, or in main chat.
(Either it is their own, or by others.)
Then it would be added to “quotes.txt”. (with the newest number) [Which I 'of course' then could edit with easy ever day.]

To protect against abuse, it would be cool to be able to “ban” certain nicknames, by the right click menu. From adding any quotes. (Then "ignoring" from that nickname until I delete it from a list, of some kind or how one may do it?) : )

Also, there should be possible to make it exclude, or ONLY include certain channels.

So, if I imagine having this thus far, I can type !quote, and other can type !quote, to get me to say a “random quote” … so what came to mind then, is that there should be a delay to how many “ 'random' quotes” I will answer in so many minutes. Say ‘max one’; then a random delay with in 10 - 90minutes, or so? (Side note: It would be nice to have the delay 'not be relevant' in the personal-message windows, but unlimited there?)

An other function that would be neat, would be; !quote “number” ..
Say all the lines in the quote.txt get a number on adding, or when I type manually by the F8, adding a new to the .txt. wink

So one could use: !quote “number” to display a selected "One liners."


And, even an other function that would be nice to have:

!quotes Which would make me say: "there is XXX number of quotes in the record!" or something like that.


I imagine it done to test for ideas once again:

I and others, can use: !quote to display a quote, (and it is randomly delayed so no spamming should occur.)
I and others, can use: !quote “number” to display a selected One liner.
I and others, can use !quotes, to see how many quotes there is in the .txt


I and others, can use: !addquote “quote”, to add a quote.
I can right-click on the names of anyone I want to not be ale to use the !addquote feature, and “ban” them from ever doing that with that nick. (so that I still see what the nick say, but won't reply to any off the commands, but the !quote, and !quote "number".)

Maybe even be able to "ban" certain nicks from using any feuture, if they abuse.

If I wanted to disable the script for certain channels, I could do that to? Maybe by just allowing specified channels? [(Some might be bothered by use of this feature, even though there is so many lines that it won’t get repetitive, .. and is growing ‘each day’. (and the random delay)]

Anyone up for ALL THIS scripting?

(I know very little coding myself.)


I can only be thankful by words, and in spirit, though…
Thank you for reading my request!
And have a fine, fine day! laugh


Edited by gomp (02/09/06 04:05 AM)
_________________________
I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.

Top
#157032 - 02/09/06 04:08 AM Re: request: advanced script to act as a "bot"...
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
The only person that posted here regarding eggdrops is Firestarter.

There is one script that is linked, which is very simple and would work as a quote bot, but as I said, it's simple, so it may not meet your "advanced" needs.
Orions Belt also posted a code, which is quite a bit lengthier and detailed. Definetely more advanced than the linked code.

Both of the codes shown are for mIRC, not eggdrops.

Top
#157033 - 25/09/06 07:07 PM Re: request: advanced script to act as a "bot"...
gomp Offline
Fjord artisan

Registered: 14/06/04
Posts: 243
Loc: Norway.
OK.

But I know no coding..

All I wish for is that somoene with the knowledge time and lust to make the stuff I ask for in the first post, step by step.

I 'might' make it one day when I learn coding, but that is long ahead in time, ..
So I'll rather see someone elese make it for me if someone find pleasure in doing it, ..

laugh
_________________________
I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.

Top
#157034 - 25/09/06 09:42 PM Re: request: advanced script to act as a "bot"...
OrionsBelt Offline
Fjord artisan

Registered: 25/04/06
Posts: 464
Loc: Amsterdam, NL
Quote:
...a "bot", for quotes, and I might adapt the script to also function as a mantra-quoter, in #buddhism, etcetera..


Originally you ask for a script to work on a bot.
Which is easily possible.
Later on, you say:

Quote:
Subsequently triggering; <my-nick> “random Quote” …


So, is it a bot that you want or do you want everything to function from your own nick?

Anyway, if you want I can make a script that suits most of your requirements coming weekend or something.

It will:
- work from a bot only (2nd mIRC client)
- have the quotes.txt file
- have the !quote, !addquote, !quote <nr> commands
- only work on specified channels
- show the total amount of quotes (!quotes)

It will NOT:
- be able to ban specified users from the script
- have a delay in replying on the commands
- work with your F8 script, unless you modify it.

So, it does meet most of your requirements, but not all.
Let me know if I should bother.

Top
#157035 - 25/09/06 11:21 PM Re: request: advanced script to act as a "bot"...
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
OrionsBelt, if you want, I can do this up fairly quickly so you won't have to this weekend. Just let me know. Most of it is a matter of only a few lines.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#157036 - 26/09/06 12:51 AM Re: request: advanced script to act as a "bot"...
OrionsBelt Offline
Fjord artisan

Registered: 25/04/06
Posts: 464
Loc: Amsterdam, NL
Sure Riamus.
But since nobody actually gave his requirements a go, I thought I'll give it a try.
But please, do your thing grin

Top
#157037 - 26/09/06 10:50 PM Re: request: advanced script to act as a "bot"...
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Ok, this is untested, but it should work fine and has (I think) everything asked for.

You can add quotes, view random quotes, view specific quotes, see how many quotes there are, have access in only specific channels as well as access in PM, have a 10-90min delay between when it can be used in channel and no limit in PM, and has the ability to ban a user from using it.

You will need to replace the RED text with the channel(s) that you want to allow and the BLUE text with the random time delay (600 = 10 minutes, 5400 = 90 minutes... just change the minimum and maximum to the number of seconds). Personally, I'd suggest the random time being 5-10 minutes unless it gets abused.

Code:
on *:text:!quote*:*: {
  if ($level($address($nick,8)) == Quote.Ban) { return }
  else var %who = $nick
  if ($chan) {
    if (!$istok([color:red]#channel1 #channel2 #channel3 #channel4 #channel5[/color],$chan,32)) { return }
    var %who = $chan
    if (%quote.delay) {
      .notice $nick Please try again after $duration(%quote.delay) or use !quote in a PM.
      return
    }
    else set -u [ $+ [ $rand([color:blue]600,5400[/color]) ] ] %quote.delay On
  }
  if ($2) {
    if ($2 !isnum) { msg %who $2 is not a number. | return }
    if ($lines(quotes.txt) &lt; $2) { msg %who Quote # $+ $2 doesn't exist. | return }
    msg %who $read(quotes.txt,$2)
  }
  elseif ($1 == !quotes) { msg %who Total quotes: $lines(quotes.txt) }
  else msg %who $read(quotes.txt)
}

on *:text:!addquote:*: {
  if ($2 == $null) { .notice $nick You need to include a quote to add. }
  else write quotes.txt $2-
}

menu nick {
  !Quote Ban: auser Quote.Ban $address($snick($chan,1),8)
}


USE:
!quote = Display random quote
!quote N = Display quote #N (N is a number)
!quotes = Display the number of quotes
!addquote quote = Add the quote

Also, you can right click on a nick in the nick list and ban him/her from using !quote, !quotes, and !quote N. To unban the nick, press Alt-R, then click Users. All bans for quotes are listed as Quote.Ban:nick!*ident@*.host.com (they all start with Quote.Ban). Just delete the one(s) that you want to unban.

Feel free to change the error texts and the output texts to whatever wording sounds best to you. I included checks for errors in use to help prevent users from not understanding why something wasn't working. In fact, close to half the lines are error checks. wink

If something doesn't work, please let me know and explain as much as you can about what isn't working (including any error messages in the status and/or channel windows).

Note that if you want to use !quote yourself (and you don't have this on a bot), I'll have to include some more code for it to work for your own inputs. If you need that, just let me know.

****One final note. The quotes.txt file will *not* have line numbers in the text file. It doesn't need them for you to be able to access specific lines. The text file should include one quote per line and no line numbers.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#157038 - 27/09/06 06:27 AM Re: request: advanced script to act as a "bot"...
OrionsBelt Offline
Fjord artisan

Registered: 25/04/06
Posts: 464
Loc: Amsterdam, NL
lol, pretty neat.
If I would have written it, it would have been at least 3 times more lines of code.
But yeah, looks like this should do what he wanted. Nice one.

Top
#157039 - 24/10/06 05:37 PM Re: request: advanced script to act as a "bot"...
gomp Offline
Fjord artisan

Registered: 14/06/04
Posts: 243
Loc: Norway.
Quote:
Quote:
...a "bot", for quotes, and I might adapt the script to also function as a mantra-quoter, in #buddhism, etcetera..


Originally you ask for a script to work on a bot.
Which is easily possible.
Later on, you say: ...


Do you not see the diference of A "bot", and, A bot?

As you say, I go on to specify it later in the very same post..

Anyways.. That is that.. Thank you for giving it a go, either way..

Seems Riamus2 got it already so now on to testing!

laugh

Top
#157040 - 24/10/06 05:41 PM Re: request: advanced script to act as a "bot"...
gomp Offline
Fjord artisan

Registered: 14/06/04
Posts: 243
Loc: Norway.
Thank all of you for helping BTW, I will choce my words more carfull later on.

On to testing! laugh

I am happy now! smile

Top
#157041 - 24/10/06 06:10 PM Re: request: advanced script to act as a "bot"...
gomp Offline
Fjord artisan

Registered: 14/06/04
Posts: 243
Loc: Norway.
You sure did it!

Thank you ever so much!

laugh

found only two thing I struggle to get, one thing is this response:

Please try again after 0 or use !quote in a PM.

Is that 0, showing how much of the random delay there is left?

It seems to be showing only the number 0 no matter when.
Is that something to fix?

And I do not get the "right click on a nick in the nick list and ban him/her from using !quote, !quotes, and !quote N."
Part. Maybe I am doing something wrong. right click on a nick in the nick list, I just get the old options of Info whois, etcetera.

smile

I am not sure what I am doing. grin


I cannot get the !addquote to work either..

I am really "not good" at this... confused

Top
#157042 - 14/11/06 01:44 AM Re: request: advanced script to act as a "bot"...
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Code:
on *:text:!quote*:*: {
  if ($level($address($nick,8)) == Quote.Ban) { return }
  else var %who = $nick
  if ($chan) {
    if (!$istok([color:red]#channel1 #channel2 #channel3 #channel4 #channel5[/color],$chan,32)) { return }
    var %who = $chan
    if (%quote.delay) {
      .notice $nick Please try again after $duration(%delay) or use !quote in a PM.
      return
    }
    else {
      var %delay = $rand([color:blue]600,5400[/color])
      set -u [ $+ [ %delay ] ] %quote.delay %delay
    }
  }
  if ($2) {
    if ($2 !isnum) { msg %who $2 is not a number. | return }
    if ($lines(quotes.txt) &lt; $2) { msg %who Quote # $+ $2 doesn't exist. | return }
    msg %who $read(quotes.txt,$2)
  }
  elseif ($1 == !quotes) { msg %who Total quotes: $lines(quotes.txt) }
  else msg %who $read(quotes.txt)
}

on *:text:!addquote*:*: {
  if ($2 == $null) { .notice $nick You need to include a quote to add. }
  else write quotes.txt $2-
}

menu nicklist {
  !Quote Ban: auser Quote.Ban $address($snick($chan,1),8)
}


There you go. Fixed a couple errors for you.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#157043 - 14/11/06 04:39 AM Re: request: advanced script to act as a "bot"...
gomp Offline
Fjord artisan

Registered: 14/06/04
Posts: 243
Loc: Norway.
Thank you again!

laugh

Top
#157044 - 14/11/06 04:52 AM Re: request: advanced script to act as a "bot"...
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Fixed one more thing. Sorry.

Code:
on *:text:!quote*:*: {
  if ($level($address($nick,8)) == Quote.Ban) { return }
  else var %who = $nick
  if ($chan) {
    if (!$istok([color:red]#channel1 #channel2 #channel3 #channel4 #channel5[/color],$chan,32)) { return }
    var %who = $chan
    if (%quote.delay) {
      .notice $nick Please try again after $duration(%quote.delay) or use !quote in a PM.
      return
    }
    else {
      var %delay = $rand([color:blue]600,5400[/color])
      set -u [ $+ [ %delay ] ] %quote.delay %delay
    }
  }
  if ($2) {
    if ($2 !isnum) { msg %who $2 is not a number. | return }
    if ($lines(quotes.txt) &lt; $2) { msg %who Quote # $+ $2 doesn't exist. | return }
    msg %who $read(quotes.txt,$2)
  }
  elseif ($1 == !quotes) { msg %who Total quotes: $lines(quotes.txt) }
  else msg %who $read(quotes.txt)
}

on *:text:!addquote*:*: {
  if ($2 == $null) { .notice $nick You need to include a quote to add. }
  else write quotes.txt $2-
}

menu nicklist {
  !Quote Ban: auser Quote.Ban $address($snick($chan,1),8)
}
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#157045 - 15/11/06 04:14 PM Re: request: advanced script to act as a "bot"...
gomp Offline
Fjord artisan

Registered: 14/06/04
Posts: 243
Loc: Norway.
Thankx!

Is it easy to make it "liten" to me too?

laugh
_________________________
I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.

Top
Page 1 of 2 1 2 >