Well its just a quick lil script, allows users to play slots, earn cash and buy snacks for other users (coloured ascii stuff >.<)
Im in need of ideas for earning cash so i posted this here in an attempt to get people to give ideas.
Commands:
!fdcommands - FOODS lists
!money - Your money
!slots - Slots
!transfer - Transfer cash
And yes this was a literal 5-10 min script.
Ascii by Austin (he viewed someother peoples work and tried copying , he didnt litterally copy n paste , well i dont think he did)
alias money {
if (!$read(money.txt, s, $2)) {
if (!%money [ $+ [ $nick ] ]) {
msg $chan 3I have noticed you do not have any money, i will give you $ $+ 20 as a nice present, only once.
write money.txt $2 20
set %money [ $+ [ $nick ] ] yes
}
}
if ($read(money.txt, s, $2) >= $1) {
var %money $calc($read(money.txt, s, $2) - $1)
write -ds $+ $2 money.txt
write money.txt $2 %money
}
else {
msg $chan 3You dont have enough money for that. That costs $ $+ $1 and you only have $iif($read(money.txt, s, $2),$ $+ $read(money.txt, s, $2),$ $+ 0) type !earn to see how you can earn money!
halt
}
}
alias add {
var %money $calc($read(money.txt, s, $1) + $2)
write -ds $+ $1 money.txt
write money.txt $1 %money
}
on *:TEXT:!money:# {
if (!$2) {
msg $chan 3You have a total of $iif($read(money.txt, s, $nick),$ $+ $read(money.txt, s, $nick),$ $+ 0)
}
else {
msg $chan 3 $+ $2 $+ has a total of $iif($read(money.txt, s, $2),$ $+ $read(money.txt, s, $2),$ $+ 0)
}
}
on *:TEXT:!transfer*:# {
if ($3 isnum) {
if ($3 > 0) {
money $remove($3,$) $nick
add $nick - $+ $3
add $2 $3
msg $chan 3Transfer complete, your balance is now $iif($read(money.txt, s, $nick),$ $+ $read(money.txt, s, $nick),$ $+ 0) $+ , $2 $+ 's balance is $iif($read(money.txt, s, $2),$ $+ $read(money.txt, s, $2),$ $+ 0)
}
else {
msg $chan 3You have to transfer more than $ $+ 0.
}
}
else {
msg $chan 3You need to specify an ammount: !transfer NICK money
}
}
on *:TEXT:!earn:# {
msg $chan 3Play some slots !slots
}
on *:TEXT:!slots:# {
money 2 $nick
var %1 $rand(1,$rand(1,9))
var %2 $rand(1,$rand(1,9))
var %3 $rand(1,$rand(1,9))
;Second rand inside rand is to make it easier (somehow) to win cash... i was experimenting and it worked
msg $chan 7( $+ %1 $+ ) 11( $+ %2 $+ ) 4( $+ %3 $+ )
if (%1 == %2 && %3 == %1) { msg $chan 3Congratulations you won $ $+ $calc(%1 * 2) | add $nick $calc(%1 * 2) }
elseif (%1 == %2 || %1 == %3 || %2 == %3 ) { msg $chan 3Congratulations you won $ $+ %1 | add $nick %1 }
else {
msg $chan 4Sorry you lost $ $+ 2 | add $nick -2
}
}
on *:TEXT:*:# {
if ($1 == !fdcommands) {
.msg $chan 3Food commands: !Tootsie !coke !pepsi !mtndew !7up !drpepper !pep !coffee !weed !candy !sprite !grape !orange
}
if ($2) {
if ($2 == $me) {
msg $chan 3I iz too cool for mah own stuff
halt
}
if ($1 == !TootSIE) {
money 1 $nick
/describe $chan gives $2 a 2,0>(5,5|0,5TOOTSIE ROLL5,5|1,0)<
}
if ($1 == !coke) {
money 2 $nick
/describe $chan tosses $2 a can of 15,15|0,4 Coke 15,15|
}
if ($1 == !pepsi) {
money 1 $nick
/describe $chan tosses $2 a can of 15,15|0,12 PEPSI 15,15|
}
if ($1 == !mtndew) {
money 1 $nick
/describe $chan tosses $2 a can of 15,15|8,3 MtnDew 15,15|
}
if ($1 == !7up) {
money 1 $nick
/describe $chan tosses $2 a can of 15,15|0,3 74,3º0,3UP 15,15|
}
if ($1 == !Drpeper) {
money 2 $nick
/describe $chan tosses $2 a can of 15,15|0,5 Dr Pepper 15,15|
}
if ($1 == !pep) {
money 1 $nick
/describe $chan gives $2 a 1,0>(0,2 PEP-O-MINT 1,0)<
}
if ($1 == !coffee) {
money 3 $nick
/describe $chan gives $2 a cup of steaming hot Coffee 0,5""""2,0]
}
if ($1 == !Weed) {
money 10 $nick
/describe $chan rolls and lights some 1,9 WEED for $2
}
if ($1 == !Candy) {
money 2 $nick
/describe $chan gives $2 a 0,4C4,0a0,4n4,0d0,4y4,0C0,4a4,0n0,4e! Merry Christmas!
}
if ($1 == !Sprite) {
money 1 $nick
/describe $chan tosses $2 a can of 15,15!14,140,3 Sprite 15,15!
}
if ($1 == !Grape) {
money 3 $nick
/describe $chan tosses $2 a can of 15,15|0,6 Grape 15,15|
}
if ($1 == !Orange) {
money 2 $nick
/describe $chan tosses $2 a can of 15,15!1,7 Orange 15,15!
}
}
else {
if ($1 == !TootSIE) {
money 1 $nick
/describe $chan gives $nick a 2,0>(5,5|0,5TOOTSIE ROLL5,5|1,0)<
}
if ($1 == !coke) {
money 2 $nick
/describe $chan tosses $nick a can of 15,15|0,4 Coke 15,15|
}
if ($1 == !pepsi) {
money 1 $nick
/describe $chan tosses $nick a can of 15,15|0,12 PEPSI 15,15|
}
if ($1 == !mtndew) {
money 1 $nick
/describe $chan tosses $nick a can of 15,15|8,3 MtnDew 15,15|
}
if ($1 == !7up) {
money 1 $nick
/describe $chan tosses $nick a can of 15,15|0,3 74,3º0,3UP 15,15|
}
if ($1 == !Drpeper) {
money 2 $nick
/describe $chan tosses $nick a can of 15,15|0,5 Dr Pepper 15,15|
}
if ($1 == !pep) {
money 1 $nick
/describe $chan gives $nick a 1,0>(0,2 PEP-O-MINT 1,0)<
}
if ($1 == !coffee) {
money 3 $nick
/describe $chan gives $nick a cup of steaming hot Coffee 0,5""""2,0]
}
if ($1 == !Weed) {
money 10 $nick
/describe $chan rolls and lights some 1,9 WEED for $nick
}
if ($1 == !Candy) {
money 2 $nick
/describe $chan gives $nick a 0,4C4,0a0,4n4,0d0,4y4,0C0,4a4,0n0,4e! Merry Christmas!
}
if ($1 == !Sprite) {
money 1 $nick
/describe $chan tosses $nick a can of 15,15!14,140,3 Sprite 15,15!
}
if ($1 == !Grape) {
money 3 $nick
/describe $chan tosses $nick a can of 15,15|0,6 Grape 15,15|
}
if ($1 == !Orange) {
money 2 $nick
/describe $chan tosses $nick a can of 15,15!1,7 Orange 15,15!
}
}
}
Very nice, just a few things you could do like,
$iif($read(money.txt, s, $2),$ $+ $read(money.txt, s, $2),$ $+ 0)
You could use the $v1 identifier, save some bytes i guess :P.
$iif($read(money.txt, s, $2),$v1,0)
And you for the good amount of $+ you have, You could use $+(Item1,Item2,Item3)
$+(7(,%1,)11(,%2,)4(,%3,))