Church script on request

By Bielie on Jun 24, 2010

A script that a user of my bot requested.

Works with random lines.

!church

<User> -> !church
<BOT> -> User went to the church and prayed at the altar. User used this command 1 time(s).

Pretty useless. Was fun to make though!

;;use this command to add random lines for your command. (add atleast 1 line or it wont work.
/write church.txt <line>
;;this line to open the file and delete mismatches
/run church.txt
;;Dont forget to save the file after changing.

on $*:text:/^[!.](church)/Si:#:{
;;floodcontrol/delay
 if (%flood [ $+ [ $nick ] ] { return }
 set -eu3 %flood [ $+ [ $nick ] ] x
;;the random lines command
 var %random = $read(church.txt)
;;channel where it doesnt work
 if ($chan == #chan) { halt }
;;error message;; Small chance that it takes place
 if (%random == $null) { notice $nick An unknown error has accured. }
;;when everything is right it triggers the command
 else { inc %church [ $+ [ $nick ] ] 1 | msg # $nick went to the church and %random $+ . $nick used this command %church [ $+ [ $nick ] ] time(s). []4([]2Script by[]10 Bielie $+ []4) | halt }
}

Comments

Sign in to comment.
RevJohn Straub   -  Jul 02, 2010

gotta love the pointless scripts

 Respond  
Jethro   -  Jun 24, 2010

Sorry to say, but this "rough snippet" is frankly pointless. You can, however, get all the random gibberish from the world wide web and make a socket out of it...

 Respond  
TheNitelyfe   -  Jun 24, 2010

yet another runescape swift-tard ._.

 Respond  
Jethro   -  Jun 24, 2010

Like napa said, you really need to test your code before submitting it. Anyway, your script can be written as such with a simple if-then-else statement (Yes, one if statement with && operators):

on $*:text:/^[!.](church)/Si:#:{
  if ((!%flood [ $+ [ $nick ] ]) && ($chan != #chan) && (!$exists(church.txt))) {
    set -eu3 %flood [ $+ [ $nick ] ] x
    notice $nick An error occured; I can't find the data located in my directory!
  }
  else {
    inc %church
    msg # $nick went to the $regml(1) and $read(church.txt) $+ . $&
      $nick has used this command %church $iif(%church > 1,times,time) $+ .
  }
}
 Respond  
napa182   -  Jun 24, 2010

?

you should really test things before you post them.
you seem to have a few errors in ur code

 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.