Random Quit Message

By Savage_CL on May 16, 2011

Right click anywhere. make a list of random quits you want. Use the "Notepad" button if you have a long list already :)

menu * {
  Custom Quits
  .Quit: quit
  .-
  .Quit List: quitlist
}
alias quitlist { dialog -m quits quits }
alias quit {
  if ($isfile(quits.txt) && ($lines(quits.txt) >= 1)) {
    var %total $lines(quits.txt)
    !quit Random Quit: $read(quits.txt,$rand(1,%total))
  }
  else { !quit $me is using "Random Quit" by Savage_CL! }
}
dialog quits {
  title "Custom Quits"
  size -1 -1 210 116
  option dbu
  text "Custom Quits by Savage_CL!",        1, 3 5 209 8, center
  list                    34, 61 17 145 95, size
  button "Add",           35, 10 20 45 12
  button "Edit",          36, 10 35 45 12
  button "Delete",        37, 10 50 45 12
  button "Up",            38, 10 65 21 12
  button "Down",          39, 34 65 21 12
  button "Notepad",       46, 10 80 45 12
}
on 1:dialog:quits:init:0:{
  $iif($isfile(quits.txt),loadbuf -o quits 34 quits.txt)
}
;add button (tab 2)
on 1:dialog:quits:sclick:35: {
  write quits.txt $input(New Quit Message?,eo,Custom Quits)
  did -r quits 34
  loadbuf -o quits 34 quits.txt
}

;edit button (tab 2)
on 1:dialog:quits:sclick:36: {
  if ($did(quits,34).sel != 0) {
    write -l $+ $didwm(quits,34,$did(quits,34).seltext) quits.txt $input(Edit:,eo,Custom Quits,$did(quits,34).seltext)
    did -r quits 34
    loadbuf -o quits 34 quits.txt
  }
}
;delete button (tab 2)
on 1:dialog:quits:sclick:37: {
  var %tempselline $did(quits,34).sel
  if (%tempselline != 0) {
    write -dl $+ $did(quits,34).sel quits.txt
    did -r quits 34
    loadbuf -o quits 34 quits.txt
    did -c quits 34 %tempselline
  }
}

;up/down buttons
on 1:dialog:quits:sclick:38,39: {
  var %mSel = $did(quits, 34).sel, %mText = $did(quits, 34).seltext, %op = $iif($did == 38, -, +), %nSel = $calc(%mSel %op 1)
  var %sText = $did(quits, 34, %nSel).text
  if (%nSel > 0 && %nSel < $calc(1+$did(quits, 34).lines)) { 
    did -oc quits 34 %nSel %mText
    did -o quits 34 %mSel %sText 
  }
  savebuf -o quits 34 quits.txt
}

;notepad button (tab 2)
on 1:dialog:quits:sclick:46: {
  did -r quits 34
  run quits.txt
  $iif($input(Please click ok when you are done editing!,o,Custom Quits),loadbuf -o quits 34 quits.txt)
}

Comments

Sign in to comment.
Savage_CL   -  Jun 16, 2011

but that requires copy and paste and it's tedious. I understand that yours is a different way, and I appreciate that, but I wrote mine as a dialog for a reason.

 Respond  
blackvenomm666   -  Jun 16, 2011

the quitlist clicker will show you what your quits are in an echo savage

 Respond  
Savage_CL   -  Jun 16, 2011

Also, how do you remember what all of the quit messages are?

 Respond  
Jethro   -  Jun 13, 2011

Also, I forgot to mention you may be better off using the: .play $me quits.txt

 Respond  
blackvenomm666   -  Jun 13, 2011

oopshaha

 Respond  
Jethro   -  Jun 13, 2011

blackvenomm666> write -d quits.txt $$?="Enter a new quit to add"this line is incorrect. You may want to look into it.

 Respond  
blackvenomm666   -  Jun 12, 2011
menu nicklist,channel,status { 
Randomquits
.Add: { Write quits.txt $$?="Enter a new quit to add" }
.Del: { write -d quits.txt $$?="Delete what quit messag?" }
.Clear All Quits: { write -c quits.txt }
.Quitlist: { quits }
}
alias quits {
  var %a = 1, %b = $lines(p2pquits.txt)
  while (%a <= %b) {
    echo -a  $read(quits.txt, %a) 
    inc %a
  } 
}
 Respond  
Savage_CL   -  Jun 12, 2011

I could, but I like the dialog because you need the list anyway. maybe a quick-add button or a list of all quits...
I'll look into it. :)

 Respond  
blackvenomm666   -  Jun 12, 2011

you could also use a right click menu to do so:)

 Respond  
Savage_CL   -  Jun 12, 2011

blackvenomm666, I've been trying to move away from aliases in all of my scripts, except in the case of local ones used for a set of common tasks or custom identifiers. i believe dialogs are easier for the end user, especially for something like this, and more importantly, my tracker script. If you would like, i can make aliases for this script too, but i find them unnecessary.

 Respond  
blackvenomm666   -  Jun 06, 2011

well i like the dialog script for it to add/delete/viea the quit messages to the text easier but then again you can make aliases for doing that as well

 Respond  
Jethro   -  Jun 06, 2011

Wow...that is new. I'm glad it's worked for you. I feel it's less of a hassle to take advantage of mIRC's built-in quit box instead of a whole dialog script for it.

 Respond  
blackvenomm666   -  Jun 06, 2011

jethro your's worked perfectly fine for me it randomly chooses things i have from my set txt doc on quit and msgs the channels

 Respond  
Jethro   -  May 16, 2011

Never mind. Upon giving my own tip a whirl, it doesn't quite work as intended...:P

 Respond  
Jethro   -  May 16, 2011

There is one shortcut one can do by taking advantage of mIRC's built-in quit message box via its options under IRC -> Messages. In the box, simply put:

$iif($read(test.txt),$v1,$1-)

And when you don't want any quit message, just clear the box.

At any rate, good, clean coding. :)

cptpan  -  Mar 14, 2013

Jethro you are a champ

Sign in to comment

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.