Quote

By napa182 on Aug 31, 2007

Updated and still updating...
copy/paste into a new remote click in a channel or ur menubar to open.

Image

dialog q {
  title "Quote System."
  size -1 -1 179 165
  option dbu
  box "Quote List", 1, 2 2 175 77
  list 2, 4 11 171 57, size hsbar vsbar
  box "Usermode Access !addquote", 3, 2 79 87 22
  check "All", 4, 4 88 16 9
  check "+o", 5, 20 88 18 9
  check "+h", 6, 38 88 18 9
  check "+v", 7, 56 88 19 9
  check "r", 8, 75 88 13 9
  box "Usermode Access !quote", 9, 90 79 87 22
  check "All", 10, 92 88 16 9
  check "+o", 11, 108 88 18 9
  check "+h", 12, 126 88 18 9
  check "+v", 13, 144 88 18 9
  check "r", 14, 162 88 13 9
  box "Add/Rem Channels", 15, 2 102 54 61
  edit "", 16, 4 111 50 9, autohs
  list 17, 4 121 50 28, size
  button "Add", 18, 4 151 25 10, flat
  button "Rem", 19, 29 151 25 10, flat
  box "Add/Rem Quote's", 20, 57 102 120 31
  edit "", 21, 59 111 116 9, autohs
  button "Add", 22, 59 121 58 10, flat
  button "Remove", 23, 117 121 58 10, flat
  box "Functions", 24, 57 137 64 26
  button "Echo", 25, 59 148 20 10, flat
  button "Msg", 26, 79 148 20 10, flat
  button "Close", 27, 99 148 20 10, flat cancel
  box "Flood Control", 28, 122 137 55 26
  button "Set", 29, 124 148 31 10, flat
  edit "", 30, 156 148 18 9, center
  text "", 31, 4 69 84 8, center
  text "", 32, 91 69 84 8, center
}
on *:exit:{ hsave quotes quotes.hsh }
on *:start:{ if (!$hget(quotes)) { hmake quotes 100 } | hload quotes quotes.hsh }
on *:load:{ if (!$hget(quotes)) { hmake quotes 100 } | hload quotes quotes.hsh }
alias -l quotes { var %x = 1 | while (%x <= $hget(quotes,0).item) { did -za q 2 $hget(quotes,%x) | inc %x } } 
menu menubar,channel {
  .Quote System:{ dialog $iif($dialog(q),-v,-md) q q }
}
on *:dialog:q:init:0:{
  if (%q.aa1) { did -c $dname 4 } 
  if (%q.ao1) { did -c $dname 5 }
  if (%q.ah1) { did -c $dname 6 }
  if (%q.av1) { did -c $dname 7 }
  if (%q.ar1) { did -c $dname 8 }
  if (%q.aa2) { did -c $dname 10 }
  if (%q.ao2) { did -c $dname 11 }
  if (%q.ah2) { did -c $dname 12 }
  if (%q.av2) { did -c $dname 13 }
  if (%q.ar2) { did -c $dname 14 }
  did -a $dname 30 %floodsec
  did -a $dname 32 Quote Number $iif(!$did(2).sel,0,$did(2).sel) Selected
  did -a $dname 31 $hget(quotes,0).item Quotes Total
  didtok $dname 17 44 %quotechan
  $quotes
}
on *:dialog:q:sclick:*:{
  if ($did == 25) { if (!$did(2).seltext) { noop $input(Please Select A Quote To Echo,uwo,Error!) } | else { echo -a 4,1Quote:0,1 $+($chr(40),$did(2).sel,$chr(32),$chr(47),$chr(32),$hget(quotes,0).item,$chr(41)) $did(2).seltext } }
  if ($did == 26) { if (!$did(2).seltext) { noop $input(Please Select A Quote To Message,uwo,Error!) } | else { msg $active 4,1Quote:0,1 $+($chr(40),$did(2).sel,$chr(32),$chr(47),$chr(32),$hget(quotes,0).item,$chr(41)) $did(2).seltext } }
  if ($did == 5 || $did == 6 || $did == 7 || $did == 8) { did -u $dname 4 }
  if ($did == 4) { did -u $dname 5-8 }
  if ($did == 11 || $did == 12 || $did == 13 || $did == 14) { did -u $dname 10 }
  if ($did == 10) { did -u $dname 11-14 }
  $iif($did(4).state == 0,unset %q.aa1,set %q.aa1 ohvr) 
  $iif($did(5).state == 0,unset %q.ao1,set %q.ao1 o)
  $iif($did(6).state == 0,unset %q.ah1,set %q.ah1 h)
  $iif($did(7).state == 0,unset %q.av1,set %q.av1 v)
  $iif($did(8).state == 0,unset %q.ar1,set %q.ar1 r)
  $iif($did(10).state == 0,unset %q.aa2,set %q.aa2 ohvr) 
  $iif($did(11).state == 0,unset %q.ao2,set %q.ao2 o)
  $iif($did(12).state == 0,unset %q.ah2,set %q.ah2 h)
  $iif($did(13).state == 0,unset %q.av2,set %q.av2 v)
  $iif($did(14).state == 0,unset %q.ar2,set %q.ar2 r)
  if ($did == 2) { did -ra $dname 32 Quote Number $did(2).sel Selected }
  if ($did == 18) {
    if (!$did(16).text || $left($did(16).text,1) != $chr(35) || $istok(%quotechan,$did(16).text,44)) { 
      noop $iif(!$did(16).text,$input(No Channel Was Entered,uwo,Error!),$iif($left($did(16).text,1) != $chr(35),$input(Please Enter Channel As Syntax: #channel,uwo,Syntax Error!),$iif($istok(%quotechan,$did(16).text,44),$input(Channel Already Exists,uwo,Error!),)))
      did -r $dname 16
    }
    else { 
      set %quotechan $addtok(%quotechan,$did(16).text,44)
      did -r $dname 16,17
      didtok $dname 17 44 %quotechan
    }
  }
  if ($did == 19) { 
    if (!$did(16).text && !$did(17).seltext || $left($did(16).text,1) != $chr(35) && !$did(17).seltext || $did(16).text && !$did(17).seltext && !$istok(%quotechan,$did(16).text,44)) {
      noop $iif(!$did(16).text && !$did(17).seltext,$input(No Channel Was Entered Or Selected,uwo,Error!),$iif($left($did(16).text,1) != $chr(35) && !$did(17).seltext,$input(Please Enter Channel As Syntax: #channel,uwo,Syntax Error!),$iif($did(16).text && !$did(17).seltext && !$istok(%quotechan,$did(16).text,44),$input(Channel Does Not Exists,uwo,Error!),)))
      did -r $dname 16 
    }
    elseif ($did(16).text && !$did(17).seltext && $istok(%quotechan,$did(16).text,44)) {
      set %quotechan $remtok(%quotechan,$did(16).text,1,44)
      did -r $dname 16,17
      didtok $dname 17 44 %quotechan
    }
    elseif ($did(17).seltext && !$did(16).text) {
      set %quotechan $remtok(%quotechan,$did(17).seltext,1,44)
      did -r $dname 16,17
      didtok $dname 17 44 %quotechan
    }
  }
  if ($did == 29) { if ($did(30).text !isnum || !$did(30).text) {  noop $input(Please Enter Number Of Second's For Flood Control,uwo,Error!) | did -r $dname 30 } | else { set %floodsec $did(30).text } } 
  if ($did == 22) { if (!$did(21).text) { noop $input(No Quote Was Entered. Please Enter A Quote.,uwo,Error!) } | else { hadd quotes $calc($hget(quotes,0).item +1) 0,1Added by 4,1 $me $+ 0,1: $did(21).text | noop $input(Quote $did(21).text Was Entered.,uio,Entered!) | did -r $dname 21,2 | $quotes | did -ra $dname 32 Quote Number 0 Selected | did -a $dname 31 $hget(quotes,0).item Quotes Total } } 
  if ($did == 23) { if (!$did(2).sel) { noop $input(No Quote Was Selected. Please Select A Quote From The List.,uwo,Error!) } | else { noop $input(Quote $did(2).seltext Has Been Deleted.,uio,Deleted!) | hdel quotes $did(2).sel | did -r $dname 2 | $quotes | did -ra $dname 32 Quote Number 0 Selected | did -a $dname 31 $hget(quotes,0).item Quotes Total } }
}
on *:text:*:#:{
  if ($istok(%quotechan,$chan,44) && !$($+(%,quote,flood),2)) {
    if ($strip($1) == !quote && $nick(#,$nick,$iif(%q.aa2,%q.aa2,$iif(%q.ao2,%q.ao2,$iif(%q.ah2,%q.ah2,$iif(%q.av2,%q.av2,$iif(%q.ar2,%q.ar2,))))))) {
      set -u $+ %floodsec $+(%,quote,flood) on
      if (!$2) { var %@ = $hget(quotes,$r(1,$hget(quotes,0).item)).item | msg # 4,1Random Quote:0,1 $+($chr(40),%@,$chr(47),$hget(quotes,0).item,$chr(41)) 0,1 $hget(quotes,%@) }
      elseif ($2 !isnum 1- $+ $hget(quotes,0).item) { msg # Sorry $nick But That Quote Number Does Not Exist. Please Pick A Quote Number 0,1 $+($chr(40),1, - ,$hget(quotes,0).item,$chr(41)) }
      elseif ($hget(quotes,$2)) { msg # 4,1Quote:0,1 $+($chr(40),$2,$chr(47),$hget(quotes,0).item,$chr(41)) $hget(quotes,$2) }
    }
    if ($strip($1) == !addquote && $nick(#,$nick,$iif(%q.aa1,%q.aa1,$iif(%q.ao1,%q.ao1,$iif(%q.ah1,%q.ah1,$iif(%q.av1,%q.av1,$iif(%q.ar1,%q.ar1,))))))) {
      set -u $+ %floodsec $+(%,quote,flood) on
      hadd quotes $calc($hget(quotes,0).item +1) 0,1Added by 4,1 $nick $+ 0,1: $2-
      msg $chan 4,1Quote: 0,1 $2- 4,1Has Been Added! 0,1As Quote Number4,1 $hget(quotes,0).item
      if ($dialog(q)) { did -r q 2 | $quotes }
    }
  }
}

Comments

Sign in to comment.
Jethro   -  Sep 26, 2011

This is an old script by napa, and I doubt he's interested in optimizing and updating it. I'd say add the -m switch after each hadd command just to ensure the hash table is made at the time of fetching info. This should minimize the likelihood of hash table not being made and the aforementioned errors by those users posted before me.

 Respond  
boybibo   -  Sep 26, 2011

/hload: unable to open 'C:\Program Files\mIRC\quotes.hsh'

 Respond  
boybibo   -  Sep 26, 2011

im sorry sir im just a newbie and i dont know anything about scripts.. i cant make it work sir.. can you help me?

/hadd: no such table 'quotes' (line 276, script.ini)

this one appears all the time..

thanks

 Respond  
Stewie1k94   -  Jul 15, 2011

its ok i sorted it :)

 Respond  
Stewie1k94   -  Jul 15, 2011

i cant get it to add a quote why is this? i have added the channel in the dialog but still wont work

  • /hadd: no such table 'quotes' (line 109, script18.ini)
 Respond  
Jethro   -  Jun 06, 2011

Person, why don't you make a request at the forum? I'm sure someone available will write a code for you.

 Respond  
Person   -  Jun 06, 2011

Oh, well do you know any link to a script that is a greet script that doesnt need a bot ,Napa182??

 Respond  
napa182   -  Jun 05, 2011

wow such an old snippet an it is in need of an edit. maybe when i have some free time il get around to doing so.
@Person this is not a greet code, nor does it have anything to do with a greet.

 Respond  
Person   -  Jun 05, 2011

how do we show off the quote? i mean, i already got to the stage of saving it,but i want it to appear everytime a person under a certain nick logs in as a greet.

 Respond  
pacino23   -  Oct 15, 2010

Excellent script. The menu makes it very easy to use as well. Gets a straight 10, faultless. Thanks for posting, my bot/channel really needed a quote adder.

 Respond  
PuNkTuReD   -  Apr 01, 2009

very nice napa182
gets a 10 from me

 Respond  
RicJames   -  Apr 01, 2009

excellent thanks

 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.