Ghalerion Quote Edit

By Riht_2 on Mar 20, 2008

Small edit to Ghalerion Quote script

;x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x
;                    Ghalerion Script
;                      By Kouketsu
;_________________________________________________________
;Currently Viewing: Quote System
;Description: Basic quote system. And yeah.
;Aliases Defined: loadquote, qfind, quote
;Dialogs Included: Quote
;x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x
dialog quote {
  title "Quote System"
  size 200 200 230 184
  option dbu
  list 1, 1 11 228 95, size
  button "Random", 2, 1 107 55 11
  button "Delete", 3, 57 107 55 11
  button "View Quotes", 4, 113 107 55 11
  button "Refresh List", 5, 169 107 55 11
  button "Add", 7, 191 120 30 11
  edit "", 8, 1 120 189 11, autohs
  button "Find", 9, 191 132 34 11
  edit "", 10, 1 132 189 11, autohs
  text "Current:", 11, 1 146 54 11
  edit "", 12, 22 145 200 22, read, return, multi, autovs, vsbar
  text "Double-Click To Message Quote to Active Window", 13, 1 1 228 10, center
  button "+", 14, 222 120 7 11
  button "Copy messege to Clipboard", 15, 1 168 228 16, flat
}
alias loadquote {
  did -r quote 1 
  var %i = 1
  while (%i <= $lines(quotes.txt)) {
    did -a quote 1 $strip($read(quotes.txt,%i))
    inc %i
  }
}
on *:dialog:quote:init:0:{
  loadquote
  ; did -z quote 1 1 3
  did -a quote 8 Place Quote here
  did -a quote 10 Place Keyword here
  dll $dl MarkDialog $dname
  dll $mdx SetFont $dname 1,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32 -11 400 Tahoma
}
on *:dialog:quote:sclick:1:{ /did -ra quote 12 $did(quote,1).seltext }
on *:dialog:quote:dclick:1:{ /did -ra quote 12 $did(quote,1).seltext | msg $active $gtalk(Quote:) $did(1).seltext  }
on *:dialog:quote:sclick:2:{ msg $active $gtalk(Random Quote:) $read(quotes.txt) }
on *:dialog:quote:sclick:3:{ set %num.del $did(quote,1).sel | write -dl $+ %num.del quotes.txt | loadquote }
on *:dialog:quote:sclick:4:{ run quotes.txt }
on *:dialog:quote:sclick:5:{ loadquote }
on *:dialog:quote:sclick:7:{ set %newquote $did(quote,8) | write quotes.txt %newquote | msg $active $gtalk(Added Quote:) %newquote }
on *:dialog:quote:sclick:9:{ set %qc $did(quote,10) | qfind %qc }
on *:dialog:quote:sclick:14:{ dialog -m quote.extend quote.extend }
on *:dialog:quote:sclick:15:{ if ($did(12) != $Null) /did -ra quote 12 $did(quote,1).seltext | clipboard $gtalk(Quote:) $did(1).seltext | echo -a Copied $gtalk(Quote:) $did(1).seltext }
alias qfind {
  write -c quote2.txt
  set %qc2 1
  set %quot3 0
  :Quote 
  inc %qc2
  if (%qc2 > $lines(quotes.txt)) { goto end }
  set %Quote $read(quotes.txt,%qc2)
  if (%QC isin %Quote) { write quote2.txt %quote | inc %quot3 | goto quote }
  else { goto quote } 
  :end
  if ($lines(quote2.txt) > 0)  { .play $active quote2.txt }
  if ($lines(quote2.txt) == 0) { halt }
}
on *:dialog:quote:close:*:{
  .timers off
}
alias quote {
  if ($dialog(quote) != $null) { dialog -v quote | halt }
  else { dialog -md quote quote }
}
dialog quote.extend {
  title "Auto-Formatting For Quotes"
  size -1 -1 312 206
  option pixels notheme
  edit "Quote goes here.", 1, 12 51 245 147, autohs multi return hsbar vsbar
  edit "New Addition. Just copy-paste the quoted text directly here. Script does the rest for you. ^^", 2, 9 6 280 43, read multi return
  button "Add", 3, 260 79 48 24
  button "Clear", 4, 262 106 45 25
  button "Exit", 5, 263 176 45 23
}
on *:dialog:quote.extend:sclick:*:{
  if ($did == 4) {
    did -r quote.extend 1 
  }
  if ($did == 5) {
    dialog -x quote.extend
  }
  if ($did == 3) {
    unset %newquote
    set %lin.quote $did(quote.extend,1).lines
    var %q = 1
    while (%q <= %lin.quote) {
      set %newquote [ %newquote ] $+ $chr(32) $+ $did(quote.extend,1,%q).text
      inc %q
    }
    write quotes.txt %newquote
    loadquote
    dialog -x quote.extend
    if ($dialog(quote)) dialog -v quote
  }
}

Comments

Sign in to comment.
Riht_2   -  Jun 14, 2008

It\'s really only for people who run Ghalerion. :sweat:

 Respond  
EL   -  Mar 20, 2008

Hmm seems eh:

  dll $dl MarkDialog $dname
  dll $mdx SetFont $dname 
 Respond  
napa182   -  Mar 20, 2008

dll error\'s it seems it needs a dll for it to work right

 Respond  
guest598594   -  Mar 20, 2008
    if ($dialog(quote)) dialog -v quote

you need another \"quote\" at the end

 Respond  
Riht_2   -  Mar 20, 2008

Not really my script, I did some editing that might be good.

 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.