Quote System

By Firstmate on Jul 31, 2008

Well its a quote system.
Has a couple commands.
To edit the people who can delete, ban, remove bans. Edit the var on the first line:
var %Quotes.list [nick1] [nick2]...etc

Key:

< >'s-mandatory [ ]'s-Optional Commands: !addquote | Adds a new quote !quote [#] | Accepts the option # to go to directly to that quote #, otherwise msgs a random quote. !delquote <#> | Delete the specified Quote by quote number, $nick must be in %Quote.list to do so. !search | Searchs all the quotes for text and gives first result. To ban or remove a nick from the ban list, right click on their name and got to the menu Add/remove bans. (Thanks napa) Ban is now by their $address, so changing their nick won't help them. Note: $'s are not allowed for obvious reasons. ```mirc on *:LOAD: { set %Quote.list } on *:TEXT:*:#: { if ($1 == !quote) { if ($2) { if ($2 isnum) { if ($read(Quotes.txt,$2) != $null) { msg $chan Quote $chr(35) $+ $2 $+ : $read(Quotes.txt,$2) } else { msg # Line doesn't exist } } else { msg # Please provide a number } } else { set %lines $rand(1,$lines(Quotes.txt)) msg $chan Quote $chr(35) $+ %lines $+ : $read(Quotes.txt,%lines) } } if ($1 == !addquote) { if ($address($nick,1) isin %Quote.ban) { msg # You are banned from adding quotes! } else { if ($2) { if ($chr(36) isin $2-) { msg # Invalid Characters! } else { write Quotes.txt $2- $+ , Added by $nick msg # Added! } } } } if ($1 == !delquote) { if ($nick isin %Quote.list) { if ($2) { if ($read(Quotes.txt,$2) != $null) { write -dl $2 Quotes.txt msg # Line deleted } else { msg # Line doesn't exist } } } } if ($1 == !search) { if ($2) { if ($read(Quotes.txt,w,* $+ $2 $+ *) != $null) { msg # $read(Quotes.txt,w,* $+ $2 $+ *) } else { msg # No results found } } } if ($1 == !lastquote) { set %lines $lines(Quotes.txt) msg # Quote $chr(35) $+ %lines $+ : $read(Quotes.txt,%lines) } } menu nicklist { .Add/Del user's ..$iif($address($1,1) isin %Quote.ban,$style(2)) Add $+($chr(40),$1,$chr(41)): { set %Quote.ban $addtok(%Quote.list,$address($1,1),32) | echo -a User $+($chr(40),$1,$chr(41)) has been added. } ..$iif($address($1,1) !isin %Quote.ban,$style(2)) Del $+($chr(40),$1,$chr(41)): { set %Quote.ban $remtok(%Quote.list,$address($1,1),1,32) | echo -a User $+($chr(40),$1,$chr(41)) has been removed. } ..$iif(!%Quote.ban,$style(2)) $+($chr(91),$numtok(%Quote.ban,32),$chr(93)) $+(User's,$chr(58)) List them: { echo -a $gettok(%Quote.list,1-,32) } } ```

Comments

Sign in to comment.
troll   -  Apr 22, 2011

i like this

 Respond  
morfina   -  Feb 08, 2010

is there a way to add a command to show all the quotes by numbers ?

 Respond  
Firstmate   -  Oct 01, 2008

Yes, that's how its supposed to be, is it not working properly?

 Respond  
IKillYou   -  Sep 28, 2008

Hmm maybe it is just because I'm a noob - but when the script is loaded - it seems to me, that all userses may add quotes, and if you define any userser - theese are 'ban' from adding quotes ?!

IKY

 Respond  
napa182   -  Aug 02, 2008

go with address 2 instead of 1

 Respond  
Firstmate   -  Aug 02, 2008

hmm, quick question, how would you make it so that it adds to the banlist by hostname/address or something.
That way they can\'t just change their name.
Would it be:

menu nicklist {
  .Add/Del user\'s
  ..$iif($1 isin %Quote.list,$style(2)) Add $+($chr(40),$1,$chr(41)): { set %Quote.list $addtok(%Quote.list,$address($1,1),32) | echo -a User $+($chr(40),$1,$chr(41)) has been added. }
  ..$iif($1 !isin %Quote.list,$style(2)) Del $+($chr(40),$1,$chr(41)): { set %Quote.list $remtok(%Quote.list,$address($1,1),1,32) | echo -a User $+($chr(40),$1,$chr(41)) has been removed. }
  ..$iif(!%Quote.list,$style(2)) $+($chr(91),$numtok(%Quote.list,32),$chr(93)) $+(User\'s,$chr(58)) List them: { echo -a $gettok(%Quote.list,1-,32) }
}

Ty for the snippet too.

Lol No one rated it :(

 Respond  
napa182   -  Aug 01, 2008

um instead of an alias you can also use menu nicklist to add or remove users like this

menu nicklist {
  .Add/Del user\'s
  ..$iif($1 isin %Quote.list,$style(2)) Add $+($chr(40),$1,$chr(41)): { set %Quote.list $addtok(%Quote.list,$1,32) | echo -a User $+($chr(40),$1,$chr(41)) has been added. }
  ..$iif($1 !isin %Quote.list,$style(2)) Del $+($chr(40),$1,$chr(41)): { set %Quote.list $remtok(%Quote.list,$1,1,32) | echo -a User $+($chr(40),$1,$chr(41)) has been removed. }
  ..$iif(!%Quote.list,$style(2)) $+($chr(91),$numtok(%Quote.list,32),$chr(93)) $+(User\'s,$chr(58)) List them: { echo -a $gettok(%Quote.list,1-,32) }
}
 Respond  
Firstmate   -  Aug 01, 2008

Ohhhh, lol sry napa. I got a little confused what you guys were saying, i get it now.

Edit:
-Added 2 aliases to add/remove people in the list
-Added on LOAD event for the list.

I\'ll add the $istok...etc. later.

Any other comments?

 Respond  
napa182   -  Jul 31, 2008

problem is that the way you have it.. it\'s not going to set the var local or global

 Respond  
Eugenio   -  Jul 31, 2008

you need to make that first line: *on :LOAD: { set %Quote.list }**
otherwise that var isnt going to be set, its before any event in the script, that is what Napa is trying to say, ya get me bru ?!?

 Respond  
Firstmate   -  Jul 31, 2008

All you have to do is add a name, of course I do a alias to add onto it. But I don\'t see what the problem is....

 Respond  
napa182   -  Jul 31, 2008

well for 1 adding var %Quote.list nick on the first line before the script is even triggered is not going to set nothing unless you set the var and nicks you want to use it in ur var list or have it set within the script it\'s self.

 Respond  
Firstmate   -  Jul 31, 2008

I can add the aliases, but I don\'t really see the point in doing things like that...
Just a different way to do it.

 Respond  
napa182   -  Jul 31, 2008

then why not have that var as a set var and have it as an on load
like

on *:load:{ set %Quote.list nick1,nick2,nick3 }

then on ur read for that just use

if ($istok(%Quote.list,$nick,44))

or you could add an option to add or remove nicks from that var maybe useing an alias like

alias Anick { set %Quote.list $addtok(%Quote.list,$1,44) }
alias Rnick { set %Quote.list $remtok(%Quote.list,$1,1,44) }
 Respond  
Firstmate   -  Jul 31, 2008

Yes it is, just add the people who can delete, ban, remove bans to the list.
i.e.
var %Quote.list Firstmate Nick2 Nick3

 Respond  
Pass   -  Jul 31, 2008

I don\'t think the first line was intentional.

var %Quote.list 
on *:TEXT:*:#: {
 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.