Top

Max's Quote Dialog


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  May 18, 2009
Last Updated  May 29, 2009
Tags  dialog  quote  socket 

Introduction



This is another quote script for my collection. I made this to test using simple sockets in dialogs. And seeing as it worked fine, and pretty decent. Here it is.

It's obvious how it works. When you open the dialog, it'll show a quote, just click "Get another quote" to refresh the quote. You can send the quote to the channel, or to send it in a query to someone specific. To send a query to someone, just type their nick in the textbox and click "Send to nick".


Have fun with it. =]

Grab the Code

dialog Quote {
  title "Max's Quote Dialog"
  size -1 -1 160 136
  option dbu
  box "Quote", 1, 5 5 151 72
  text , 2, 11 15 139 56, center
  button "Get Another Quote", 3, 21 80 56 11
  button "Send Quote To Channel", 4, 51 107 67 11
  edit "", 5, 21 93 56 11, autohs
  button "Send Quote To Nick", 6, 78 93 67 11
  button "Close Dialog", 7, 65 122 36 11, ok cancel
  button "Copy Quote To Clipboard", 8, 78 80 67 11
}
 
alias -l htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) | return %x }
 
alias qdialog {
  if (!$sock(quotationspage)) {
    sockopen quotationspage www.quotationspage.com 80
  }
}
on *:sockopen:quotationspage: {
  sockwrite -n $sockname GET /random.php3 HTTP/2.0
  sockwrite -n $sockname Host: www.quotationspage.com
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname $crlf
}
on *:sockread:quotationspage: {
  sockread %quotationspage
  if (<dt class="quote"> isin %quotationspage) {
    set %quote %quotationspage
  }
}
on *:sockclose:quotationspage: {
  set %author $htmlfree($gettok(%quote,19-,62))
  did -a Quote 2 $qt($remove($htmlfree(%quote),%author)) - %author
}
 
on *:Dialog:Quote:init:*: {
  qdialog
}
 
on *:Dialog:Quote:sclick:*: {
  if ($did == 3) { qdialog | unset %quot* %author }
  if ($did == 4) { msg $active $did(Quote,2).text }
  if ($did == 6) { msg $did(Quote,5) $did(Quote,2).text }
  if ($did == 8) { clipboard $did(Quote,2) }
}
 
 
Menu * {
  .Max's Quote Dialog: { dialog -m Quote Quote }
}

Comments

  (5)  RSS
WorldDMT
Comments: 169
 
mIRC Snippet:  Max's Quote Dialog
Posted on May 18, 2009 4:04 am
hi

for "button "Close Dialog", 7, 84 95 34 9, ok cancel" put only ok or cancel like this

Code:
button Close Dialog, 7, 84 95 34 9, ok



for the alias htmlfree u can do this

Code:
alias -l htmlfree return $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,)


for dialog event u have be sur if $active is a chan and the id 5 isnt empty and u can replace $did(Quote,2).text to only $did(2) so

Code:
on *:Dialog:Quote:sclick:*:{
  if ($did == 3) { qdialog | unset %quot* %author }
  elseif (($did == 4) && ($active == #)) msg $v1 $did(2)
  elseif (($did == 6) && ($did(5))) msg $v1 $did(2)
}


attention!! dont use a "*" into menu

must be menu status,nicklist,menubar becose if u have a game coded with picwin u will get "Max's Quote Dialog" into the menu and that is not good
Aucun50
Comments: 548
 
mIRC Snippet:  Max's Quote Dialog
Posted on May 18, 2009 9:46 pm
I like it although the buttons seem a little small for the words in them, they look somewhat smushed together.
MaxEvans
Comments: 89
 
mIRC Snippet:  Max's Quote Dialog
Posted on May 18, 2009 10:25 pm
I'll fix the buttons. I need to re-arrange the dialog too.
MaxEvans
Comments: 89
 
mIRC Snippet:  Max's Quote Dialog
Posted on May 19, 2009 11:21 pm
I edited the dialog and made it a bit smaller, and made the button size bigger.
MaxEvans
Comments: 89
 
mIRC Snippet:  Max's Quote Dialog
Posted on May 29, 2009 11:21 am
Added clipboard button to copy the quote to the clipboard for sharing with friends or family (or anyone else). =]

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom