Hi again.
If you remember using my other quote system that uses .txt files, you may have experienced pain and discomfort, due to its unprofessional way of approaching things such as adding users and dealing with latest quote information.
I wouldn't say this new snippet is a "modification" of my previous quote system, but rather an alternative version of it, with a few alterations.
Some things that are new:
How to use:
It's quite self-explanatory.
Virtually everything you can do in the dialog, you can do through a bot command.
**Tab 1)*** Add/Delete/Edit quotes
<@noob> !quote find o
<@KublaiKhan> Matching Quote #2: woototo
<@noob> !quote find o
<@KublaiKhan> Matching Quote #5: Whoa, slow down.
<@noob> !quote find -a o
<@KublaiKhan> There were 3 items that matched your search.
The -a switch signifies "all", so it would return the total number of matches the bot found.
Updates:
Update #1 - (Fri Feb 27, 9:37 AM): Added importing .txt or .ini files to the quote system.
[i]Notice: .ini files must be in the form of:
[Quotes]
1=Hello there.
2=Calm down!
3=<Henry> I need a file. || <Michael> You misspelled 'life'
, where the quote itself is the "value" portion of the .ini.[/i]
Things to add in v3:
Pardon the weird, squiggly paint lines.
Enjoy! :D
alias quotem dialog $iif($dialog(quotem),-v,-m) quotem quotem
alias -l qa { noop $regex(quote,$1,/.*(@.*)/) | return $+(*!*,$regml(quote,1)) }
alias -l quotimer { var %x $hget(quote,0).item, %y $r(1,$(%x,2)) | .amsg Random Quote $+(,$chr(35),$hget(quote,%y).item,,:) $hget(quote,%y).data }
alias -l import {
var %x $lines($1), %y 1, %z 1
while (%y <= %x) {
while ($hget(quote,%z)) { inc %z }
hadd -m quote %z $read($1,%y) | hadd -m quoteinfo %z $+(Nick: $+(,$me,),$chr(124),Address: $+(,$iif($status,$gettok($address($me,5),2,33),Quote Owner),),$chr(124),Time/Date: $+(,$fulldate,),$chr(124),Network: $+(,$network,),$chr(124),Channel: $+(,$iif($status,$iif($active != #,$chan($r(1,$chan(0))))),Quote Dialog),))
inc %y
}
}
alias -l importini {
var %w $gettok($gettok($read($1,1),1,91),1,93), %x $lines($1), %y 1, %z 1
while (%y < %x) {
while ($hget(quote,%z)) { inc %z }
hadd -m quote %z $readini($1,%w,%y) | hadd -m quoteinfo %z $+(Nick: $+(,$me,),$chr(124),Address: $+(,$iif($status,$gettok($address($me,5),2,33),Quote Owner),),$chr(124),Time/Date: $+(,$fulldate,),$chr(124),Network: $+(,$network,),$chr(124),Channel: $+(,$iif($status,$iif($active != #,$chan($r(1,$chan(0))))),Quote Dialog),))
inc %y
}
}
on *:start: { if (!$hget(quote)) { hmake Quote 100 } | if (!$hget(quoteinfo)) { hmake QuoteInfo 100 } | if (!$hget(quotestatus)) { hmake QuoteStatus 100 } | if (!$hget(quoteusers)) { hmake QuoteUsers 100 } | if (!$hget(quoteint)) { hmake QuoteInt 100 } | if (!$hget(quotetimer)) { hmake QuoteTimer 100 } | if ($file(quotes.ini)) { hload -i Quote quotes.ini Quote | hload -i QuoteInfo quotes.ini QuoteInfo | hload -i QuoteStatus quotes.ini QuoteStatus | hload -i QuoteUsers quotes.ini QuoteUsers | hload -i QuoteInt quotes.ini QuoteInt | hload -i QuoteTimer quotes.ini QuoteTimer } }
on *:exit: { hsave -i Quote quotes.ini Quote | hsave -i QuoteInfo quotes.ini QuoteInfo | hsave -i QuoteStatus quotes.ini QuoteStatus | hsave -i QuoteUsers quotes.ini QuoteUsers | hsave -i QuoteInt quotes.ini QuoteInt | hsave -i QuoteTimer quotes.ini QuoteTimer }
on *:text:!quote*:#: {
if (!$hget(quotestatus,0).item) { hadd -m quotestatus 1 on }
if (!$hget(quoteusers,0).item) { .notice $nick You haven't added any users. Use the Quote Manager dialog to add some. | halt }
if (!$2 && !$hget(quote,0).item) { .notice $nick You haven't added any quotes. Use: !quote add to add one. }
var %x $hget(quote,0).item, %z $hget(quoteusers,$wildsite), %u Owner Master Friend Blacklist NoAccess, %c Commands are: !quote[s], !quote [#], !quote find <# / -a >>, !quote add , !quote del <#/all>, !quote info [#], !quote edit [#] , !quote access, !quote users , !quote timer , !quote status , %w Insufficient access., %s on off
if ($hget(quotestatus,1) == $gettok(%s,1,32)) {
if (%z == blacklist) { .notice $nick You are blacklisted. Contact an administrator or owner. | halt }
if ($1 == !quotes) { .msg # There are a total of $hget(quote,0).item quotes added to the database. }
elseif (%x != 0) {
if (!$2) { var %y $r(1,$(%x,2)) | if (!$hget(quote,%y)) { .msg $chan It appears that Quote $+(,$chr(35),%y,,:) has been erased. Use: !quote add to fill it in. } | else { .msg # Random Quote $+(,$chr(35),$hget(quote,%y).item,,:) $hget(quote,%y).data } }
elseif ($2 isnum) { if ($hget(quote,$2)) { .msg # Quote $+(,$chr(35),$2,,:) $hget(quote,$2) } | elseif (!$hget(quote,$2)) { .msg $chan It appears that Quote $+(,$chr(35),$2,,:) has been erased. Use: !quote add to fill it in. } | else { .notice $nick There are only $hget(quote,0).item quotes added. } }
elseif ($2 == find) {
if (!$3) { .notice $nick Syntax: $+(,$gettok(%c,3,44),) }
else { if (!$4) { var %x $hfind(quote,$+(*,$3,*),$r(1,$hfind(quote,$+(*,$3,*),0,w).data),w).data | if ($hget(quote,%x)) { .msg # Matching Quote $+(,$chr(35),%x,,:) $hget(quote,%x) } | else { .msg # There were 0 items that matched your search. } } | else { var %x $hfind(quote,$+(*,$4,*),0,w).data | if ($3 == -a) { .msg # There were %x items that matched your search. } | elseif ($3 isnum 1- %x) { .msg # Matching Quote $+(,$chr(35),$hfind(quote,$+(*,$4,*),$3,w).data,,:) $hget(quote,$hfind(quote,$+(*,$4,*),$3,w).data) } } }
}
}
if ($2 == add) { if ($istok($gettok(%u,1-3,32),%z,32)) { if (!$3) { .notice $nick Syntax: $+(,$gettok(%c,4,44),) | halt } | var %x 1 | while ($hget(quote,%x)) { inc %x } | hadd -m quote %x $3- | .msg # Added Quote $+(,$chr(35),%x,,:) $3- | hadd -m quoteinfo %x $+(Nick: $+(,$nick,),$chr(124),Address: $+(,$address,),$chr(124),Time/Date: $+(,$fulldate,),$chr(124),Network: $+(,$network,),$chr(124),Channel: $+(,#,)) } | else { .notice $nick %w } }
if ($2 == del) { if ($istok($gettok(%u,1-2,32),%z,32)) { if (!$3) { .notice $nick Syntax: $+(,$gettok(%c,5,44),) } | if ($3 isnum) { if ($hget(quote,$3)) { .msg # Deleted Quote $+(,$chr(35),$3,,:) $hget(quote,$3) | hdel quote $3 | hdel quoteinfo $3 } | elseif (!$hget(quote,$3)) { .notice $nick Either Quote $+(,$chr(35),$3,) has not been added yet, or it has already been deleted. } } | elseif ($3 == all) { hfree quote | hfree quoteinfo | hmake quote 100 | hmake quoteinfo 100 | .msg # All existing quotes have been permanently deleted. | .timerquote off | hadd -m quotetimer 1 off } } | else { .notice $nick %w } }
if ($2 == edit) { if ($istok($gettok(%u,1-2,32),%z,32)) { if ($3 isnum) { if (!$4-) { .notice $nick Syntax: $+(,$gettok(%c,7,44),) } | else { if ($hget(quote,$3)) { .msg # Edited Quote $+(,$chr(35),$3,:) $4- | hadd quote $3 $4- | hadd quoteinfo $3 $+(Nick: $+(,$nick,),$chr(124),Address: $+(,$address,),$chr(124),Time/Date: $+(,$fulldate,),$chr(124),Network: $+(,$network,),$chr(124),Channel: $+(,#,)) } | elseif (!$hget(quote,$3)) { .notice $nick Either Quote $+(,$chr(35),$3,) has not been added yet, or it already has been deleted. } } } | else { .notice $nick Syntax: $+(,$gettok(%c,7,44),) } } | else { .notice $nick %w } }
if ($2 == info) { if ($istok($gettok(%u,1-3,32),%z,32)) { if (!$3) { .notice $nick Syntax: !quote info [#] } | elseif (!$hget(quoteinfo,$3) && ($3 isnum)) { .notice $nick $iif(!$hget(quote,1),You haven't added any quotes. Use: !quote add to add a quote.,There are only $hget(quote,0).item quotes added.) } | elseif ($3 isnum) { .msg # $hget(quoteinfo,$3) } } | else { .notice $nick %w } }
if ($2 == users) {
if ($istok($gettok(%u,1-2,32),%z,32)) {
if (!$3) { .msg # There are a total of $hget(quoteusers,0).item users added to the database. - Use: $+(,$gettok(%c,9,44),) to add/del/modify users. | halt }
if ($3 && !$4) { .notice $nick Syntax: $+(,$gettok(%c,9,44),) }
elseif ($4) && ($istok($gettok(%u,1-5,32),$3,32)) {
if (!$address($4,2) && $4) { who $4 $+($chr(37),$chr(104))n }
set %q.nick $nick | set %q.use $4 | set %q.chan #
if ($3 == Owner) && (%z == Owner) { if ($address($4,2)) { hadd -m quoteusers $address($4,2) Owner | .msg # $4 has been added as an Owner. } | else { set %q.lev Owner | set %q.cmd hadd -m } }
if ($3 == Master) && (%z == Owner) { if ($address($4,2)) { hadd -m quoteusers $address($4,2) Master | .msg # $4 has been added as a Master. } | else { set %q.lev Master | set %q.cmd hadd -m } }
if ($3 == Friend) { if (%z == Owner) { if ($address($4,2)) { hadd -m quoteusers $address($4,2) Friend | .msg # $4 has been added as a Friend. } | else { set %q.lev Friend | set %q.cmd hadd -m } } | elseif (%z == master) { if ($address($4,2)) && (!$istok($deltok($gettok(%u,1-4,32),3,32),$hget(quoteusers,$address($4,2)),32)) { hadd -m quoteusers $address($4,2) Friend | .msg # $4 has been added as a Friend. } | else { set %q.bac 1 } } | else { .notice $nick %w } }
if ($3 == NoAccess) { if (%z == Owner) { if ($address($4,2)) { hdel quoteusers $address($4,2) | .msg # $4 no longer has access. } | else { set %q.cmd hdel } } | elseif (%z == Master) { if ($address($4,2) && $hget(quoteusers,$address($4,2)) == Friend) { hdel quoteusers $address($4,2)) | .msg # $4 no longer has access. } | else { set %q.rec 1 } } | else { .notice $nick %w } }
if ($3 == Blacklist) && (%z == Owner) { if ($address($4,2)) { hadd -m quoteusers $address($4,2) blacklist | .msg # $4 has been blacklisted. } | else { set %q.cmd hadd -m | set %q.lev Blacklist } }
}
else { .notice $nick Syntax: $+(,$gettok(%c,9,44),) }
}
else { .notice $nick %w }
}
if ($2 == access) { if ($hget(quoteusers,$address($nick,2))) { .notice $nick You are currently a $+(,$v1,) on $+(,$me,) - Use: !quote commands to get a list of available commands for you. } | else { .notice $nick You do not have a significant access enough to perform some quote commands - Use: !quote commands to get a list of available commands for you. } }
if ($2 == commands) { if (%z == owner) { .notice $nick %c } | elseif (%z == master) { .notice $nick $replace($gettok(%c,1-9,44),<#/all>,[#],,) } | elseif (%z == friend) { .notice $nick $+($deltok($gettok(%c,1-6,44),5,44),$chr(44),$gettok(%c,8,44)) } | elseif (!%z) { .notice $nick $gettok(%c,1-3,44) } }
if ($2 == timer) {
if ($istok($gettok(%u,1,32),%z,32)) {
if ($istok($gettok(%s,1-2,32),$3,32)) { if (!$hget(quoteint,1)) { .notice $nick 1You haven't set an inverval. Use: !quote timer <[#] (minutes)> to set an interval. | halt } | hadd -m quotetimer 1 $3 | .msg # A random Quote will $iif($hget(quotetimer,1) == on,now,no longer) be broadcasted every $hget(quoteint,1) minutes. | $iif($hget(quotetimer,1) == on,.timerquote 0 $calc($hget(quoteint,1) * 60) quotimer,.timerquote off) | halt }
if ($3 isnum) { if ($3 == 0) { .notice $nick Please supply a number higher than 0. } | else { hadd -m quoteint 1 $abs($3) | .msg # Done. A random Quote will be broadcasted every $hget(quoteint,1) minutes. | hadd -m quotetimer 1 on | .timerquote 0 $calc($hget(quoteint,1) * 60) quotimer } }
elseif (!$3) { .notice $nick Broadcasting of Random Quotes is currently $iif($hget(quotetimer,1) == on,$+(9ON,$chr(44)) every $iif($hget(quoteint,1),$v1,0) minutes.,4OFF.) - Use: $+(,$gettok(%c,10,44),) to modify options for timed quotes. }
else { .notice $nick Syntax: $+(,$gettok(%c,10,44),) }
}
else { .notice $nick %w }
}
}
if ($2 == status) {
if ($istok($gettok(%u,1,32),%z,32)) {
if ($istok($gettok(%s,1-2,32),$3,32)) { hadd -m quotestatus 1 $3 | .msg # Done. Quotes are now $+($iif($hget(quotestatus,1) == on,9ON,4OFF),.) | $iif($hget(quotestatus,1) == on,.timerquote 0 $calc($hget(quoteint,1) * 60) quotimer,.timerquote off) }
elseif (!$3) { .notice $nick Quotes are currently $+($iif($hget(quotestatus,1) == on,9ON,4OFF),.) - Use: !quote status to enable/disable the quote system. }
else { .notice $nick Syntax: $+(,$gettok(%c,11,44),) }
}
else { .notice $nick %w }
}
elseif ($hget(quotestatus,1) == $gettok(%s,2,32)) { .notice $nick Quotes are currently 4OFF. Ask an administrator or owner to turn them back on. }
}
menu * {
Quote Manager : quotem
}
dialog QuoteM {
title "Quote Manager"
size -1 -1 307 87
option dbu
tab " ~ Q u o t e s ~ ", 1, 0 -2 307 89
list 10, 8 21 32 24, tab 1 size vsbar
edit "", 11, 45 20 136 35, tab 1 read multi vsbar
button "Add Quote", 15, 258 61 36 13, tab 1
edit "", 14, 49 63 206 11, tab 1 autohs
list 12, 183 20 115 35, tab 1 size hsbar
button "Delete Quote", 13, 7 57 35 11, tab 1
box "New Quote:", 4, 46 55 252 23, tab 1
box "Existing Quotes:", 5, 4 13 297 69, tab 1
button "Edit Quote...", 26, 7 46 35 11, tab 1
button "Delete ALL", 18, 7 68 35 11, tab 1
tab " ~ U s e r s ~ ", 2
list 21, 46 21 149 36, tab 2 size vsbar
edit "", 23, 237 21 59 11, tab 2 autohs
text "Nickname:", 105, 207 22 26 8, tab 2
box "Levels", 104, 47 58 117 20, tab 2
button "Change?", 22, 166 62 30 14, tab 2
radio "Blacklist", 27, 50 65 29 10, tab 2
radio "Friend", 28, 80 65 27 10, tab 2
radio "Master", 29, 109 65 27 10, tab 2
radio "Owner", 30, 137 65 25 10, tab 2
button "Add User", 25, 223 67 59 12, tab 2
text "Access:", 106, 210 55 19 8, tab 2
combo 24, 237 54 60 43, tab 2 size drop
box "Existing Users:", 3, 4 13 194 70, tab 2
box "New User:", 6, 201 13 102 70, tab 2
button "Remove User", 7, 8 37 35 11, tab 2
text "or", 8, 217 28 6 8, tab 2
edit "", 9, 237 32 59 11, tab 2 autohs
text "Address:", 16, 208 35 23 7, tab 2
combo 17, 10 22 32 59, tab 2 size drop
button "Clear Level", 20, 8 51 35 11, tab 2
button "Clear ALL", 19, 8 65 35 11, tab 2
text "Ex. *!*@test.users.test.org", 31, 218 44 69 7, tab 2
tab " ~ E x t r a - O p t i o n s ~ ", 32
box "Quote System", 47, 24 20 87 19, tab 32
box "Timed Quote Broadcast", 48, 8 42 119 35, tab 32
check "On/Off", 52, 21 51 27 10, tab 32
radio "On", 49, 42 27 18 10, tab 32
radio "Off", 50, 76 27 18 10, tab 32
box "Quote Options:", 53, 4 12 299 72, tab 32
button "Change interval...", 46, 61 50 56 12, tab 32
text "Current Interval: (minutes)", 51, 25 65 83 8, tab 32
edit "", 54, 91 64 15 10, tab 32 read autohs center
box "Importing Files (.txt, .ini)", 56, 133 16 166 64, tab 32
button "Select a file...", 57, 247 31 43 12, tab 32
button "Select a file...", 58, 247 57 43 12, tab 32
edit "", 59, 141 32 102 11, tab 32 read
edit "", 60, 141 58 102 11, tab 32 read
box ".txt Files:", 61, 137 24 158 23, tab 32
box ".ini Files:", 62, 137 51 158 22, tab 32
tab " ~ Q u o t e - C o m m a n d s ~ ", 55
text "Legend: (e) = Everyone | (o) = Owner | (m) = Master | (f) = Friend ", 33, 73 19 163 8, tab 55
text "!quote[s] - (e)", 35, 8 29 35 8, tab 55
text "!quote [#] - (e)", 36, 8 38 38 8, tab 55
text "!quote find <# / -a >> - (e)", 34, 8 47 106 8, tab 55
text "!quote add - (omf)", 37, 8 56 65 8, tab 55
text "!quote del <#/(all)> - (om)", 38, 8 65 66 8, tab 55
text "!quote edit [#] - (om)", 40, 226 29 72 8, tab 55
box "List of Quote Commands:", 45, 5 12 297 72, tab 55
text "!quote info [#] - (omf)", 39, 243 38 55 8, tab 55
text "!quote status - (o)", 44, 228 47 70 8, tab 55
text "!quote access - (omf)", 41, 246 56 52 8, tab 55
text "!quote timer - (o)", 43, 197 65 101 8, tab 55
text "!quote users <(owner)/(master)/friend /noaccess/(blacklist)> - (om)", 42, 61 74 183 8, tab 55
}
on *:dialog:quotem:*:*: {
if ($devent == init) && ($did == 0) {
var %x 1, %y $hget(quote,0).item | while (%x <= %y) { did -a $dname 10 %x | inc %x }
did $iif(!$hget(quote,0).item,-b,-e) $dname 18 | did $iif(!$hget(quoteusers,0).item,-b,-e) $dname 19 | did -b $dname 7,13,15,20,22,24-31 | did -o $dname 3 1 Existing Users: $+($chr(40),$hget(quoteusers,0).item,$chr(41)) | did -o $dname 5 1 Existing Quotes: $+($chr(40),$hget(quote,0).item,$chr(41)) | did -c $dname $iif($hget(quotestatus,1) == on,49,50) | did $iif($hget(quotetimer,1) == on,-c,-u) $dname 52 | didtok $dname 17,24 124 Blacklist|Friend|Master|Owner | did -a $dname 54 $iif($hget(quoteint,1) isnum,$v1,N/A) | $iif(!$hget(quoteint,0).item,did -b $dname 52)
}
if ($devent == sclick) {
if ($did == 7) {
hdel quoteusers $did(21).seltext | did -r $dname 21
var %x 1, %y $hget(quoteusers,0).item | while (%x <= %y) { if ($hget(quoteusers,%x).data == $did(17)) { did -ea $dname 21 $hget(quoteusers,%x).item | did -e $dname 20 | did -b $dname 7,22,27-30 } | inc %x }
if ($did(21).lines == 0) { did -ba $dname 21 You haven't added any users of this type. | did -b $dname 7,22,27-30 }
did -o $dname 3 1 Existing Users: $+($chr(40),$hget(quoteusers,0).item,$chr(41))
}
if ($did == 10) && ($did($v1).seltext) { did -ra $dname 11 $hget(quote,$did(10).seltext) | did -r $dname 12 | did -e $dname 13,20,26 | didtok $dname 12 124 $hget(quoteinfo,$did(10).seltext) }
if ($did == 13) { hdel quote $did(10).sel | hdel quoteinfo $did(10).sel | did -d $dname 10 $did(10).sel | did -u $dname 10 | did -r $dname 11-12 | did -b $dname 13,26 | did -o $dname 5 1 Existing Quotes: $+($chr(40),$hget(quote,0).item,$chr(41)) }
if ($did == 15) {
var %x 1 | while ($hget(quote,%x)) { inc %x }
hadd -m quote %x $did(14) | hadd -m quoteinfo %x hadd -m quoteinfo %z $+(Nick: $+(,$me,),$chr(124),Address: $+(,$iif($status,$gettok($address($me,5),2,33),Quote Owner),),$chr(124),Time/Date: $+(,$fulldate,),$chr(124),Network: $+(,$network,),$chr(124),Channel: $+(,$iif($status,$iif($active != #,$chan($r(1,$chan(0))))),Quote Dialog),))
did -ra $dname 11 $did(14) | did -r $dname 10,12,14 | didtok $dname 12 124 $hget(quoteinfo,$hget(quote,0).item)
var %x 1, %y $hget(quote,0).item | while (%x <= %y) { did -a $dname 10 %x | inc %x }
did -o $dname 5 1 Existing Quotes: $+($chr(40),$hget(quote,0).item,$chr(41)) | did -b $dname 13,26
}
if ($did == 17) {
did -r $dname 21
var %x 1, %y $hget(quoteusers,0).item | while (%x <= %y) { if ($hget(quoteusers,%x).data == $did(17)) { did -ea $dname 21 $hget(quoteusers,%x).item | did -e $dname 20 | did -b $dname 7,22,27-30 } | inc %x }
if ($did(21).lines == 0) { did -ba $dname 21 You haven't added any users of this type. | did -b $dname 7,20,22,27-30 }
}
if ($did == 18) { if ($input(Are you sure you want to delete ALL quotes? This action CANNOT be undone.,vwy,Warning!) == $yes) { hfree quote | hfree quoteinfo | hmake quote 100 | hmake quoteinfo 100 | did -b $dname 13,18,26 | did -r $dname 10-12 | did -o $dname 5 1 Existing Quotes: $+($chr(40),$hget(quote,0).item,$chr(41)) | .timerquote off | hadd -m quotetimer 1 off } }
if ($did == 19) { if ($input(Are you sure you want to remove ALL users? This action CANNOT be undone.,vwy,Warning!) == $yes) { hfree quoteusers | hmake quoteusers 100 | did -r $dname 21 | did -u $dname 17 } }
if ($did == 20) {
if ($input(Are you sure you want to remove ALL users from this level $+($chr(40),$did(17).seltext,$chr(41),?) This action CANNOT be undone.,vwy,Warning!) == $yes) {
var %x $hget(quoteusers,0).item | while (%x >= 1) { if ($hget(quoteusers,%x).data == $did(17)) { hdel quoteusers $hget(quoteusers,%x).item } | dec %x }
did -bra $dname 21 You haven't added any users of this type. | did -o $dname 3 1 Existing Users: $+($chr(40),$hget(quoteusers,0).item,$chr(41))
}
}
if ($did == 21) && ($did($did).seltext) { did -e $dname 7,18,22,27-30 }
if ($did == 22) { hadd -m quoteusers $did(21).seltext %q.radio | did -d $dname 21 $did(21).sel | did -u $dname 27-30 | did -b $dname 22 | unset %q.radio }
if ($did == 24) { did -e $dname 25 }
if ($did == 25) {
if ($did(23)) { set %q.ap $did(24) | set %q.go 1 | who $v1 $+($chr(37),$chr(104)) }
if ($did(9)) { hadd -m quoteusers $qa($v1) $did(24) | did -r $dname 9,21 | did -c $dname 17 $did(24).sel | var %x 1, %y $hget(quoteusers,0).item | while (%x <= %y) { if ($hget(quoteusers,%x).data == $did(24)) { did -ea $dname 21 $hget(quoteusers,%x).item | did -e $dname 20 | did -b $dname 7,22,27-30 } | inc %x } | did -u $dname 24 | did -o $dname 3 1 Existing Users: $+($chr(40),$hget(quoteusers,0).item,$chr(41)) }
did -er $dname 9,23 | did -b $dname 24
}
if ($did == 26) { hadd -m quote $did(10).sel $input(Enter a new quote for Quote $+($chr(35),$did(10).sel,:),eoi,Attention!) | did -ra $dname 11 $hget(quote,$did(10).sel) }
if ($did isnum 27-30) { set %q.radio $did($did) }
if ($did == 46) { while (%z !isnum 1-) { var %z $input(Enter a number for an interval (in minutes) between each random quote broadcasted.,eoi,Attention!) } | hadd -m quoteint 1 %z | did -ra $dname 54 %z | hadd -m quotetimer 1 on | .timerquote 0 $calc($hget(quoteint,1) * 60) quotimer | did -ce $dname 52 }
if ($did isnum 49-50) { hadd -m quotestatus 1 $iif($did(49).state == 1,on,$iif($did(50).state == 1,off)) | $iif($hget(quotestatus,1) == on,$iif($hget(quoteint,1),.timerquote 0 $calc($hget(quoteint,1) * 60) quotimer),.timerquote off) | $iif($hget(quotetimer,1) == on,$iif($hget(quoteint,1),.timerquote 0 $calc($hget(quoteint,1) * 60) quotimer),.timerquote off) }
if ($did == 52) { hadd -m quotetimer 1 $iif($did(52).state == 1,on,$iif($did(52).state == 0,off)) | $iif($did(52).state == 1,.timerquote 0 $calc($hget(quoteint,1) * 60) quotimer,.timerquote off) }
if ($did == 57) { if ($sfile(*.txt,Choose a file to import)) { did -ra $dname 59 $qt($v1) | import $nopath($v1) | var %x 1, %y $hget(quote,0).item | while (%x <= %y) { did -a $dname 10 %x | inc %x } | did -o $dname 5 1 Existing Quotes: $+($chr(40),$hget(quote,0).item,$chr(41)) } }
if ($did == 58) { if ($sfile(*.ini,Choose a file to import)) { did -ra $dname 60 $qt($v1) | importini $nopath($v1) | var %x 1, %y $hget(quote,0).item | while (%x <= %y) { did -a $dname 10 %x | inc %x } | did -o $dname 5 1 Existing Quotes: $+($chr(40),$hget(quote,0).item,$chr(41)) } }
}
if ($devent == edit) {
if ($did == 14) { did $iif($did(14),-e,-b) $dname 15 }
if ($did == 23) { did $iif($did(23),-b,-e) $dname 9 | did $iif($did(23),-e $dname 24,-ub $dname 24-25) }
if ($did == 9) { did $iif($did(9),-b,-e) $dname 23 | did $iif($did(9),-e $dname 24,-ub $dname 24-25) }
}
}
raw 354:*: {
set %q.id $+(*,!,*,@,$2) | set %q.ex 1 | var %d quotem
if ($dialog(%d) && (%q.go)) { hadd -m quoteusers %q.id %q.ap | did -r %d 9,21 | did -c %d 17 $did(%d,24).sel | var %x 1, %y $hget(quoteusers,0).item | while (%x <= %y) { if ($hget(quoteusers,%x).data == $did(%d,17)) { did -ea %d 21 $hget(quoteusers,%x).item | did -e %d 20 | did -b %d 7,22,27,28,29,30 } | inc %x } | did -u %d 24 | did -o %d 3 1 Existing Users: $+($chr(40),$hget(quoteusers,0).item,$chr(41)) }
if (%q.rec) && ($hget(quoteusers,%q.id) == friend) { hdel quoteusers %q.id | .msg %q.chan %q.use no longer has access. }
if (%q.bac) && (!$istok(owner master blacklist,$hget(quoteusers,%q.id),32)) { hadd -m quoteusers %q.id Friend | .msg %q.chan %q.use has been added as a Friend. }
elseif (!%q.rec && !%q.bac && !%q.go) { %q.cmd quoteusers %q.id %q.lev | .msg %q.chan $iif(!%q.lev,%q.use no longer has access.,$iif(%q.lev == blacklist,%q.use has been added to the blacklist.,%q.use has been added as a $+(%q.lev,.))) }
}
raw 315:*: { if (%q.ex != 1) { if ($dialog(quotem)) { var %d quotem | did -b %d 20,24-25 | did -e %d 9 | did -u %d 17,24 | did -rab %d 21 I can't find $did(%d,23) on this network. Try another nick? | unset %q.* } | else { .notice %q.nick I can't seem to find %q.use on this network. Try another nick? | unset %q.* } } | else { unset %q.* } }
how do i make it so that NOT everyone can add quotes? the only change i did to the script were making .notice turn into .msg and changing all the confirmation messages and stuff to be PM'd to $nick but for some reason EVERYONE can add quotes and i do not want tht....
I don't know, you might have edited something vital to the script.
I've tested this again, and the only people who can add quotes are the ones who are added to the Database (hash tables).
I'll be making an update sometime later, where you can add all people who are in added channels, and so on.
Also, when adding channels through the bot command, make sure you've added yourself before too...
If you remember correctly, it was still v.2 when you first looked at it, and still v.2 as you are looking at it right now. So that means I didn't update it; if I did, it'll be v.3.
When I update, I usually post a separate comment that notifies you about it, but always check the title of the snippet when I do so.
darkarrow: It might be the fault that you may have edited a part that had the raws or the nick adding portion. Also, as I said in the description: > Warning:
This script uses raws 315 and 354, so just be aware of that. :)
It might be other scripts conflicting with those two raws.
If I may, can I see the edited script? Or shall I arrange one for your expectations?
i had to edit the script so that you didn't need access for the add quote cause i wanted everyone to be able to add quotes but its a really nice script i like it 10/10 :)
but.... when ever i tried to add a nickname to the access list with the dialog it said the nickname is not on this irc server or what ever it said and wouldn't let me add one so i used my host mask so im gana have to make it 9/10
Well this is a dumb question probably...but is it possible to have a multi-message (line) quote? If so, how? It looked like one of your quotes was actually 3 lines, I want to have that but I'm not sure how.
Edit: Nevermind I realize now that you can't...maybe you could add that though automatically when a user uses || or something? Just a thought for v3 :)
I can see you have put a lot work and thought in to this script Kirby and it shows.
Iam testing it in a fresh bot now, no errors found yet :)
Your Introduction matches the script, very well laid out, and easy to follow.
For V2 i would like to have the ability to change the bots command trigger in channel.
Exelnt snippent. 10/10.
Great! Thanks for testing it tv3636.
I might consider your idea: > For instance, if I wanted everyone to be able to add quotes (and didn't want to go through and add everyone's nickname) it would be nice to be able to just check something off and change the default access levels required so that everyone could do that.
I guess adding levels for everyone (especially if you have hundreds of people in a channel), it would obviously be time consuming.
Maybe I should add another thing to the dialog, for example having all operated users be able to perform one action, voiced users do another action, and enable all regulars to do another certain thing.
I'll think about it and add modifications in v2 of this script. :P