mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
...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

Last edited by gomp; 21/08/06 11:57 AM.

I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
Instead of anyone posting to ask me if I have not already posted this kind of post, Plese see https://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.
Joined: Jan 2006
Posts: 108
F
Vogon poet
Offline
Vogon poet
F
Joined: Jan 2006
Posts: 108
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

Joined: Aug 2006
Posts: 19
R
Pikka bird
Offline
Pikka bird
R
Joined: Aug 2006
Posts: 19


ReaperIRC
Killgore Computers
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
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.

Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
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

Last edited by gomp; 02/09/06 03:05 AM.

I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
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.
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
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.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
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

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
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.

Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
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

Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
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

Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
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

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
Thank you again!

laugh

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
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.
Page 1 of 2 1 2

Link Copied to Clipboard