scavenger hunt script

By glucht23 on Mar 31, 2014

simple script for scavenger hunt on mIRC
hope yall enjoy it

on *:start: {
  set %channel1 $$?="Enter channel:" | set %channel2 $$?="enter channel:" | set %channel3 $$?="Enter channel3:" | set %channel4 $$?="Enter channel:" | halt 
}

on *:Text:!scavengercommands:#:/msg $nick 4!scavengerhunt starts a scavengerhunt game 2!scavenger joins a scavenger game use 3!search on one of the 5 channels after you start a scavenger game and then after 1 minute it'll tell you the correct channels and who got the right points etc. and !scavengerscore tells you your score for the scavenger game

on *:text:!scavengerhunt:#: {
  if (%process == on) { notice $nick already in progress use !scavenger to join | halt }
  if ($me !isin %channel1) { join %channel1 }
  if ($me !isin %channel2) { join %channel2 }
  if ($me !isin %channel3) { join %channel3 }
  if ($me !isin %channel4) { join %channel4 }
  set %correctchannel $rand(1,5)
  if (%correctchannel == 1) {
    set %scavengerchannel %channel5
  }
  if (%correctchannel == 2) {
    set %scavengerchannel %channel4
  }
  if (%correctchannel == 3) {
    set %scavengerchannel %channel3
  }
  if (%correctchannel == 4) {
    set %scavengerchannel %channel2
  }
  if (%correctchannel == 5) {
    set %scavengerchannel %channel1
  }
  set %process on
  set %channel5 $chan
  hadd -m scavenger $nick
  msg $chan 4Scavenger hunt game started! please join channels %channel1 %channel2 %channel3 and %channel4 to play
  msg $chan a item will be on one channel and the rest will have nothing if you guess the right channel you will get a point! you have 30 seconds to join this game type 2!scavenger to join 
  timer 1 90 msg $chan the correct channel was %scavengerchannel
  timer 1 30 set %scavengerhunt on 
  timer 1 30 msg $chan scavenger hunt has begun! type !search on a channel all players have 1 minute to search and then the results will be said
  timer 1 90 unset %scavengerhunt
  timer 1 90 unset %scavengerchannel
  timer 1 93 unset %correctchannel
  timer 1 90 hfree scavenger
  timer 1 90 unset %process
  timer 1 93 unset %correct
  timer 1 93 unset %false
  timer 1 90 msg $chan nicks %correct got it right you gained 1 point
  timer 1 90 msg $chan nicks %false got it wrong you lost a point
}

on *:text:!scavenger:#: {
  if (%scavengerhunt == on) { notice $nick the game is already in progress | halt }
  if ($hget(scavenger,$nick) != $null) { notice $nick you're already in this game! | halt }
  if (%channel5 == $null) { notice $nick start a game with !scavengerhunt | halt }
  elseif (%channel5 != $null) { msg $chan 4 $nick  has been added to the scavenger hunt game | hadd scavenger $nick | halt }
}

on *:Text:!search:%channel1,%channel2,%channel3,%channel4,%channel5: {
  if (%scavengerhunt != on) { notice $nick game not started use !scavengerhunt to start the game | halt }
  if ($hget(scavenger,$nick) != $null) { notice $nick you're not playing this round | halt }
  if ($nick isin $hget(correct,nicks)) { notice $nick you've already guessed! | halt }
  if ($nick isin $hget(false,nicks)) { notice $nick you've already guessed! | halt }
  if ($chan == %scavengerchannel) { set %correct %correct $nick | var %right $calc($readini(scavengerhunt.ini,$nick,correct) + 1) |  writeini scavengerhunt.ini $nick correct %right | halt  }
  if ($chan != %scavengerchannel) { set %false %false $nick | var %wrong $calc($readini(scavengerhunt.ini,$nick,false) + 1) |  writeini scavengerhunt.ini $nick false %wrong | halt }
}

on *:text:!scavengerscore:#: {
  timer 1 1 msg # $2 $+ 's 5Correct: 11 $+ $readini(scavengerhunt.ini,$nick,correct $iif($ini(scavengerhunt.ini,$nick,correct),,0))
  timer 1 2 msg # $2 $+ 's 5Wrong: 11 $+ $readini(scavengerhunt.ini,$nick,false $iif($ini(scavengerhunt.ini,$nick,false),,0))
}

on *:text:!scavengerscore*:#: {
  timer 1 1 msg # $2 $+ 's 5Correct: 11 $+ $readini(scavengerhunt.ini,$2,correct $iif($ini(scavengerhunt.ini,$2,correct),,0))
  timer 1 2 msg # $2 $+ 's 5Wrong: 11 $+ $readini(scavengerhunt.ini,$2,false $iif($ini(scavengerhunt.ini,$2,false),,0))
}

Comments

Sign in to comment.
ProIcons   -  Apr 05, 2014

These scripts are completely useless since you are not including any documentation. Also you are using ini files and hash tables , something that is pointless, since you can use hash tables for both cases, for better optimization of your code.

glucht23  -  Apr 05, 2014

I usually prefer using ini for highscores what do you mean documentation? I'm still kind of new to mIRC scripting and just attempting on some stuff

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.