Top

Joke Bank


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  5.5 (of 2 scores)
Date Added  Mar 11, 2009
Last Updated  Mar 11, 2009
Tags  bank  dialog  joke  jokes  mirc  script  scripts 

Description

Haven't scripted in a long time, so here goes...



Well I was basically reading a joke book the other day, and thought it would be nice if you could store these jokes. So, I made this. Load into remotes and type /jokes or right-click anywhere and click "Joke Bank".

It's rather simple at the moment, but suggestions will be followed.

Additional feature: channel messaging.

!randjoke - displays a random joke to the channel (from another user)
!joke X - displays joke number X into the channel
!jokeanswer X - notices the answer of joke X to the nick

I am hoping to make the channel messaging more configurable in the future, so think of this as a template if you will.

Oh, and if you want to read my jokes so far (only 10):
What's orange and sounds like a parrot?*A carrot!
What's brown and sticky?*A stick!
What's the difference between a lightbulb and a pregnant woman?*You can unscrew a lightbulb!
What do christmas trees and priests have in common?*Their balls are just for decoration.
Why do blonde women have such big bellybuttons?*They've been sleeping with too many blonde men.
What do you call a Scottish lesbian?*Gaelic.
What do pubic hair and parsley have in common?*You push it aside, and keep on eating!
What do you call a sheep tied to a lamp-post in Wales?*A leisure center!
How did Burger King get Dairy Queen pregnant? *He forgot to wrap his whopper.
Why was the washing machine laughing?*Because it was taking the piss out of the pants.
What's the difference between a penis and a bonus?*Your wife will always blow your bonus.

Grab the Code

dialog jokes {
  title "Joke Bank"
  size -1 -1 350 104
  option dbu
  list 1, 2 2 345 65, vsbar size
  edit "", 2, 5 75 339 10, read autohs
  box "Answer", 3, 2 67 345 21
  button "Remove", 5, 273 90 37 12
  button "Add", 6, 235 90 37 12
  button "View file", 7, 311 90 37 12
}
menu * {
  Joke Bank:jokes
}
alias jokes { dialog $iif($dialog(jokes),-v,-m) jokes jokes }
on *:DIALOG:jokes:init:0: { jokesload }
on *:DIALOG:jokes:sclick:*: {
  if ($did == 6) { dialog $iif($dialog(jokeadd),-v,-m) jokeadd jokeadd }
  if ($did == 5) {
    if (!$did(1).sel) {
      noop $input(Please select a joke to remove.,uwo,Error!) 
    }
    else {
      write -dl $+ $did(1).sel $qt(jokes.txt)
      dialog -x jokes
      dialog -m jokes jokes
    }
  }
  if ($did == 7) { run $qt(jokes.txt) }
  if ($did == 4) { dialog $iif($dialog(jokeoptions),-v,-m) jokeoptions jokeoptions }
  if ($did == 1) { did -ra jokes 2 $gettok($read($qt(jokes.txt),$did(1).sel),2-,42) }
}
alias jokesload {
  if (!$isfile($qt(jokes.txt))) { halt }
  else {
    window -h @jokeslist
    loadbuf @jokeslist $qt(jokes.txt)
    var %x = 1
    while (%x <= $line(@jokeslist,0)) {
      did -a jokes 1 $gettok($line(@jokeslist,%x),1,42)
      inc %x
    }
  }
  window -c @jokeslist
}
dialog jokeadd {
  title "Add Joke"
  size -1 -1 254 58
  option dbu
  edit "", 1, 5 8 245 10, autohs
  box "Joke", 2, 2 0 250 21
  edit "", 3, 5 30 245 10, autohs
  box "Asnwer", 4, 2 22 250 21
  button "Add", 5, 215 45 37 12
}
on *:DIALOG:jokeadd:sclick:5: { 
  if (!$did(1).text) || (!$did(3).text) { 
    noop $input(Please fill in both sections.,uwo,Error!)
  }
  else {
    write -a $qt(jokes.txt) $+($did(1).text,*,$did(3).text) 
    dialog -x jokeadd
    dialog -x jokes
    dialog -m jokes jokes
  }
}
on *:TEXT:!randjoke:#: {
  if (!$lines($qt(jokes.txt))) { halt }
  else {
    var %l = $rand(1,$lines($qt(jokes.txt))) 
    msg $chan $gettok($read($qt(jokes.txt),%l),1,42)
    msg $chan Want the answer? Type !jokeanswer %l to get it.
  }
}
on *:TEXT:!jokeanswer *:#: {
  if (!$lines($qt(jokes.txt))) { halt }
  else {
    .notice $nick $gettok($read($qt(jokes.txt),$2),2-,42)
  }
}
on *:TEXT:!joke *:#: {
  if ($2 !isnum) {
    msg $chan Error! That is not a number!
  }
  elseif (!$read($qt(jokes.txt),$2)) { 
    msg $chan Error! There is not that many jokes in my database!
  }
  else {
    msg $chan $gettok($read($qt(jokes.txt),$2),1,42)
    msg $chan Want the answer? Type !jokeanswer $2 to get it!
  }
}
 
 

Comments

  (11)  RSS
^Neptune
Comments: 629
 
mIRC Snippet:  Joke Bank
Posted on Mar 11, 2009 4:28 pm
Suggestions are what are really wanted here, so I hope I get some!
Aucun50
Comments: 568
 
mIRC Snippet:  Joke Bank
Posted on Mar 11, 2009 4:34 pm
Maybe have a auto joke system like every x number of minutes it well say a joke then followed by the answer.
Blitzjager
Comments: 192
 
mIRC Snippet:  Joke Bank
Posted on Mar 11, 2009 4:42 pm
I think it would be better to have the answer on a timer.
Maybe add a dclick to the dialog to message the joke you click.
Kirby
Comments: 480
 
mIRC Snippet:  Joke Bank
Posted on Mar 11, 2009 4:54 pm
Very nice Neptune. :d
Although, I don't have any suggestions for it, although
Quote:
Maybe have a auto joke system like every x number of minutes it well say a joke then followed by the answer.
, sounds good to me. Like an /amsg?
slacker
Comments: 89
 
mIRC Snippet:  Joke Bank
Posted on Mar 11, 2009 9:38 pm
dialog is abit big for what you are having it do.
PATX
Comments: 387
 
mIRC Snippet:  Joke Bank
Posted on Mar 14, 2009 9:44 pm
kewl!rate it a 5
GreyFox
Comments: 11
 
mIRC Snippet:  Joke Bank
Posted on Mar 16, 2009 12:15 am
it looks nice... but it need more features....
Need it or not is good :) 7/10
Heyyous
Comments: 3
 
mIRC Snippet:  Joke Bank
Posted on Apr 1, 2009 11:08 pm
sweet script and i do like the idea of having random jokes every x minutes.
only thing i could think of is make it read jokes off of websites the the !quote script.
TheboyskinG
Comments: 11
 
mIRC Snippet:  Joke Bank
Posted on Sep 6, 2009 3:41 am
This snippet and !commands same with to a random msg,why not %read(name.txt) is very simple :P upZz...i give you point 90 bro :)

sorry,my english so bad :(
Ghost-writer
Comments: 353
 
mIRC Snippet:  Joke Bank
Posted on Sep 6, 2009 9:51 am
nice neptune :P. Get more jokes and join my channel with it >:3.
jonesy44
Comments: 1,892
 
mIRC Snippet:  Joke Bank
Posted on Sep 6, 2009 12:15 pm
Awesome dialog dude, real tidy :)

Commenting Options

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

  

Bottom