- On *:text:.cash:#: {
- if (%cash [ $+ [ $nick ] ] == $null) { set %cash [ $+ [ $nick ] ] 0 }
- if (%timer [ $+ [ $nick ] ] !== $null) { notice $nick Wait $duration($timer($nick).secs) before using the .cash command. | halt }
- timer $+ $nick 1 $r(180,180) unset %timer [ $+ [ $nick ] ]
- set %timer [ $+ [ $nick ] ] 1
- timer 1 1 notice $nick Wait $duration($timer($nick).secs) before using the .cash command again.
- var %r $rand(1,10)
- if (%r == 1) { notice $nick $nick steals a car and sells it for 500 dollars
- inc %cash [ $+ [ $nick ] ] 500
- }
- if (%r == 2) { notice $nick $nick Stole a strangers wallet, obatining 70 dollars
- inc %cash [ $+ [ $nick ] ] 70
- }
- if (%r == 3) { notice $nick $nick Finds 200 dollars in his trouser pocket.
- inc %cash [ $+ [ $nick ] ] 200
- }
- if (%r == 4) { notice $nick $nick Robs a bank getting away with 1,300 dollars
- inc %cash [ $+ [ $nick ] ] 1300
- }
- if (%r == 5) { notice $nick $nick Sells the last of his weed for 30 dollars
- inc %cash [ $+ [ $nick ] ] 30
- }
- if (%r == 6) { notice $nick $nick Trips over whilst at work and claims 220 dollars compensation
- inc %cash [ $+ [ $nick ] ] 220
- }
- if (%r == 7) { notice $nick $nick Sells some stuff at a carboot earning 320 dollars
- inc %cash [ $+ [ $nick ] ] 320
- }
- if (%r == 8) { notice $nick $nick Finds a wallet on the floor, and took 100 dollars
- inc %cash [ $+ [ $nick ] ] 100
- }
- if (%r == 9) { notice $nick $nick Sells some stuff on Ebay for 60 dollars
- inc %cash [ $+ [ $nick ] ] 60
- }
- if (%r == 10) { notice $nick $nick Sells there Runescape account for 150 dollars
- inc %cash [ $+ [ $nick ] ] 150
- }
- }
- alias rank {
- ;;$gwdRank(Name) returns "name :: score :: rank";;
- window -h @list1
- window -h @list2
- var %a 1
- while ($var(%cash*,%a)) {
- aline -a @list1 %cash [ $+ [ $remove($var(%cash*,%a),$+($chr(37),cash)) ] ] $remove($var(%cash*,%a),$+($chr(37),cash))
- inc %a
- }
- filter -wwteuc 1 1 @list1 @list2
- var %b $fline(@list2,* $1)
- .timer 1 0 close -@ @list*
- return $+(4,$token($line(@list2,%b),2,32)) 14has4 $+($bytes($line(@list2,%b),b),GP) 14and is ranked4 $ord(%b) $+ .
- }
- on $*:TEXT:/^[!@.]score/Si:*: {
- if (!$2) {
- if (%cash [ $+ [ $nick ] ] isnum) {
- $iif($left($1,1) == @, msg $chan, .notice $nick) $rank($nick)
- halt
- }
- if (%cash [ $+ [ $nick ] ] !isnum) {
- $iif($left($1,1) == @, msg $chan, .notice $nick) 14Sorry4 $nick $+ 14, you have no score.
- halt
- }
- }
- if ($2) {
- if (%cash [ $+ [ $2 ] ] isnum) {
- $iif($left($1,1) == @, msg $chan, .notice $nick) $rank($2)
- halt
- }
- if (%cash [ $+ [ $2 ] ] !isnum) {
- $iif($left($1,1) == @, msg $chan, .notice $nick) 14Sorry4 $2 $+ 14, has no score.
- halt
- }
- }
- }
