scores command for one arm bandit
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

scores command for one arm bandit

Started by Taime_Down, 26 January, 2004, 17:36:18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Taime_Down

Hi,
i was wondering if theres a way  to  have a command  scores  fof  this script......



---------------------------------------------

-- -- -- --

-- "The One Armed Bandit" --

-- Created by: FlipDeluXe --

-- Date: May 10 2003 --

-- -- -- --

---------------------------------------------













botName="?Ro?oCop????"

wins="bandit_wins.txt"

plays="bandit_plays.txt"

A=5

credit=0

player="foo"



function Main()



OnOrOff="off"



end





function DataArrival(user, data)

if( strsub(data, 1, 1) == "<" ) then

-- remove end pipe

data=strsub(data,1,strlen(data)-1)

-- parse the command

s,e,cmd = strfind( data, "%b<>%s+(%S+)" )



if (cmd=="!insert") and (OnOrOff=="off") then











OnOrOff="on"

A=3

player=user.sName

SendToAll(botName, "Yeah!! "..player.." just threw in a buck!")

SendToAll(botName, "started. Pull with >> !hit << in Main Chat!")

SendToAll("credits left:",A)













elseif (cmd=="!hit") and A == 0 then

OnOrOff="off"

SendToAll(botName, "Outta credits, insert coin.")





elseif (cmd=="!hit") and (OnOrOff=="off") then

SendToAll(botName, "Outta credits, insert coin!")



elseif (cmd=="!hit") and (OnOrOff=="on") and (player~=user.sName) then

SendToAll(botName, "Sorry "..user.sName.." you must wait until "..player.." is done with his round.")



elseif (cmd=="!hit") and (OnOrOff=="on") and (player==user.sName) then









local first=random(1,8)

local second=random(1,8)

local third=random(1,8)

local rollone="@"

local rolltwo="@"

local rollthree="@"



A=A-1

SendToAll("credits left:",A)

if first == 1 and second == 1 and third == 1 then

SendToAll(botName, "Cool " ..user.sName.. ", you just won 10 bucks!")

credit=credit+10

elseif first == 2 and second == 2 and third == 2 then

SendToAll(botName, "Great!! " ..user.sName.." 20 bucks for you!")

credit=credit+20

elseif first == 3 and second == 3 and third == 3 then

SendToAll(botName, user.sName..", just won 30 bucks...")

credit=credit+30

elseif first == 4 and second == 4 and third == 4 then

SendToAll(botName, "Wow! "..user.sName.." it must be your lucky day, 40 bucks!!")

credit=credit+40

elseif first == 5 and second == 5 and third == 5 then

SendToAll(botName, "yeah!! " ..user.sName.." cha-ching 50 bucks!!!")

credit=credit+50

elseif first == 6 and second == 6 and third == 6 then

SendToAll(botName, "Woohoo!! " ..user.sName.." You're on a winning spree!! 70 bucks!!!")

credit=credit+70

elseif first == 7 and second == 7 and third == 7 then

SendToAll(botName, "Wow, you won 90 bucks " ..user.sName.."!!")

credit=credit+90

elseif first == 8 and second == 8 and third == 8 then

SendToAll(botName, "Awesome!! " ..user.sName.." You just hit the jackpot! cha-ching 100 bucks!!!")

credit=credit+100





elseif first == 1 and second == 1 and third ~= 1 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 2 and second == 2 and third ~= 2 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 3 and second == 3 and third ~= 3 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 4 and second == 4 and third ~= 4 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 5 and second == 5 and third ~= 5 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 6 and second == 6 and third ~= 6 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 7 and second == 7 and third ~= 7 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 8 and second == 8 and third ~= 8 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1





elseif first ~= 1 and second == 1 and third == 1 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first ~= 2 and second == 2 and third == 2 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first ~= 3 and second == 3 and third == 3 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first ~= 4 and second == 4 and third == 4 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first ~= 5 and second == 5 and third == 5 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first ~= 6 and second == 6 and third == 6 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first ~= 7 and second == 7 and third == 7 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first ~= 8 and second == 8 and third == 8 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1





elseif first == 1 and second ~= 1 and third == 1 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 2 and second ~= 2 and third == 2 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 3 and second ~= 3 and third == 3 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 4 and second ~= 4 and third == 4 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 5 and second ~= 5 and third == 5 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 6 and second ~= 6 and third == 6 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 7 and second ~= 7 and third == 7 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first == 8 and second ~= 8 and third == 8 then

SendToAll(botName, "Great!! " ..user.sName.." a buck for you!")

credit=credit+1

elseif first ~= second and first ~= third then

SendToAll(botName,"Ahhh, too bad "..user.sName.." you won nothing...")







end





if first == 1 then

rollone="@"

elseif first == 2 then

rollone="$"

elseif first == 3 then

rollone="#"

elseif first == 4 then

rollone="&"

elseif first == 5 then

rollone="B"

elseif first == 6 then

rollone="O"

elseif first == 7 then

rollone="%"

elseif first == 8 then

rollone="?"

end



if second == 1 then

rolltwo="@"

elseif second == 2 then

rolltwo="$"

elseif second == 3 then

rolltwo="#"

elseif second == 4 then

rolltwo="&"

elseif second == 5 then

rolltwo="B"

elseif second == 6 then

rolltwo="O"

elseif second == 7 then

rolltwo="%"

elseif second == 8 then

rolltwo="?"

end



if third == 1 then

rollthree="@"

elseif third == 2 then

rollthree="$"

elseif third == 3 then

rollthree="#"

elseif third == 4 then

rollthree="&"

elseif third == 5 then

rollthree="B"

elseif third == 6 then

rollthree="O"

elseif third == 7 then

rollthree="%"

elseif third == 8 then

rollthree="?"

end

SendToAll(" ----------------------------------")

SendToAll(" One-Armed-Bandit \r\n")

SendToAll(" >>>> "..rollone.." - "..rolltwo.." - "..rollthree.." <<<< \r")

--SendToAll(" "..first.." "..second.." "..third.." \r\n")

SendToAll(" ----------------------------------")





if A == 0 then

OnOrOff="off"

SendToAll(botName, "Outta credits, insert coin.")

end



if (credit~=0) and (OnOrOff=="off") then

appendto(wins)

write("\t"," "..user.sName.." won "..credit.." Bucks \r\n")

writeto()

credit=0

end



if (A==0) and (OnOrOff=="off") then

appendto(plays)

write("",""..player.." \r\n")

writeto()



end







end

end

end




I cant find any ,  and my users   want a way  to see whos  winnin.  it has a log  ...but  i see no  way  to post in  the  main  or  PM.
 If i have overlooked something....i'm sorry  !

   thanx
       ?@?m?~?w??


 ???????T?@M?T????
 taime.mine.nu

plop

take a look @ the versions from phatty/chilla, those may hold your answer.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

SMF spam blocked by CleanTalk