My game bot i am working on, i decided to release a pre version, please do be patient, as i am currently adding many things
--[Magic]
--v0.5 [Magic] Written by Phatty
--Catagory[Games]
--This is a pre-release, so you will see a lot of changes very soon, such as saving the score
LogedIn = {}
count = {}
points = {}
maxlimit = 3
function Main()
SendA = SendToAll
Bot = "[Magic]"
DrainFusion()
end
function DrainFusion()
SendA(Bot,"Scripts have been rebooted")
SetTimer(2*65432)
end
function StartBot(level)
if level == "1" then
difficulty = "easy"
ticker = random(3)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendA(Bot,"[Magic] is set to "..difficulty)
Find(ticker)
end
function Find(ticker)
number = random(600)
--SendA(Bot,number.." x "..ticker)
killer = random(4)
Translate(killer)
end
function Translate(killer)
if killer == 1 then
barbossa = number + ticker
SendA(Bot,"Add together "..number.." and "..ticker)
elseif killer == 2 then
barbossa = number - ticker
SendA(Bot,"Subtract "..number.." from "..ticker)
elseif killer == 3 then
barbossa = number / ticker
SendA(Bot,"Divide "..number.." by "..ticker)
elseif killer == 4 then
barbossa = number * ticker
SendA(Bot,"Multiply "..number.." by "..ticker)
else
barbossa = 1
end
StartTimer()
end
function OnTimer()
SendA(Bot,"***Failed to input correct answer")
StopTimer()
StartBot(level)
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "m.start" then
if LogedIn[user.sName] == nil then
SendA(Bot,"you must be first logged in")
return 1
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if level == nil then
SendA(Bot,"remember to select a level m.start ")
else
SendA(Bot,"[Magic] has been started")
StartBot(level)
end
end
elseif cmd == "m.login" then
LogedIn[user.sName] = 1
points[user.sName] = ticker
elseif cmd == "m.score" then
user:SendData(Bot,points[user.sName])
return 1
elseif cmd == "a" then
if LogedIn[user.sName] == 1 then
s,e,answer = strfind(data,"%b<>%s+(%S+)")
if not answer == barbossa then
SendA(Bot,"Incorrect")
if count[user.sName] == nil then
count[user.sName] = 1
elseif count[user.sName] == maxlimit then
user:Disconnect()
else
count[user.sName] = count[user.sName] + 1
end
else
SendA(Bot,"***"..user.sName.." scores "..ticker.." point(s)")
points[user.sName] = points[user.sName] + ticker
StopTimer()
StartBot(level)
end
end
end
end
end
please sit back and w8 and even post ur sugestions or comments, thanx ;)
btw you will see that the aim of this bot is to be very random, soon everything will be just about random lol ;)
before i can give my comments, may i know what the purpose of this script ? said it other words...what does this script do ?
well until you test it you will never know :P
ok another update, instead of disconnected user after 3 wrong answers it removed score from the user, if the user does not have the required score to remove he/she is disconnected instead ;)
--[Magic]
--v0.55 [Magic] Written by Phatty
--Catagory[Games]
--This is a pre-release, so you will see a lot of changes very soon, such as saving the score
LogedIn = {}
points = {}
erasepoints = 3
function Main()
SendA = SendToAll
Bot = "[Magic]"
DrainFusion()
end
function DrainFusion()
SendA(Bot,"Scripts have been rebooted")
SetTimer(2*65432)
end
function StartBot(level)
if level == "1" then
difficulty = "easy"
ticker = random(3)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendA(Bot,"[Magic] is set to "..difficulty)
Find(ticker)
end
function Find(ticker)
number = random(600)
--SendA(Bot,number.." x "..ticker)
killer = random(4)
Translate(killer)
end
function Translate(killer)
if killer == 1 then
barbossa = number + ticker
SendA(Bot,"Add together "..number.." and "..ticker)
elseif killer == 2 then
barbossa = number - ticker
SendA(Bot,"Subtract "..number.." from "..ticker)
elseif killer == 3 then
barbossa = number / ticker
SendA(Bot,"Divide "..number.." by "..ticker)
elseif killer == 4 then
barbossa = number * ticker
SendA(Bot,"Multiply "..number.." by "..ticker)
else
barbossa = 1
end
StartTimer()
end
function OnTimer()
SendA(Bot,"***Failed to input correct answer")
StopTimer()
StartBot(level)
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "m.start" then
if LogedIn[user.sName] == nil then
SendA(Bot,"you must be first logged in")
return 1
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if level == nil then
SendA(Bot,"remember to select a level m.start ")
else
SendA(Bot,"[Magic] has been started")
StartBot(level)
end
end
elseif cmd == "m.login" then
LogedIn[user.sName] = 1
points[user.sName] = ticker
elseif cmd == "m.score" then
user:SendData(Bot,points[user.sName])
return 1
elseif cmd == "a" then
if LogedIn[user.sName] == 1 then
s,e,answer = strfind(data,"%b<>%s+(%S+)")
if not answer == barbossa then
SendA(Bot,"Incorrect")
if points[user.sName] < erasepoints then
user:SendPM(Bot,"You have zero score so i cant take points away from u, so i will disconnect you instead :P")
user:Disconnect()
else
points[user.sName] = points[user.sName] - erasepoints
end
else
SendA(Bot,"***"..user.sName.." scores "..ticker.." point(s)")
points[user.sName] = points[user.sName] + ticker
StopTimer()
StartBot(level)
end
end
end
end
end
added some more pointless randomiseation
--[Magic]
--v0.56 [Magic] Written by Phatty
--Catagory[Games]
--This is a pre-release, so you will see a lot of changes very soon, such as saving the score
LogedIn = {}
points = {}
erasepoints = 3
function Main()
SendA = SendToAll
Bot = "[Magic]"
DrainFusion()
end
function DrainFusion()
number = random(5)
if number == 1 then
SendA(Bot,"Scripts have been rebooted")
elseif number == 2 then
SendA(Bot,"Warning scripts restarted")
elseif number == 3 then
SendA(Bot,"It's all [Magic] when scripts restart")
elseif number == 4 then
SendA(Bot,"Why do these scripts keep restarting")
elseif number == 5 then
SendA(Bot,"Will you stop restarting scripts :P")
end
SetTimer(2*65432)
end
function StartBot(level)
if level == "1" then
difficulty = "easy"
ticker = random(3)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendA(Bot,"[Magic] is set to "..difficulty)
Find(ticker)
end
function Find(ticker)
number = random(600)
--SendA(Bot,number.." x "..ticker)
killer = random(4)
Translate(killer)
end
function Translate(killer)
if killer == 1 then
barbossa = number + ticker
SendA(Bot,"Add together "..number.." and "..ticker)
elseif killer == 2 then
barbossa = number - ticker
SendA(Bot,"Subtract "..number.." from "..ticker)
elseif killer == 3 then
barbossa = number / ticker
SendA(Bot,"Divide "..number.." by "..ticker)
elseif killer == 4 then
barbossa = number * ticker
SendA(Bot,"Multiply "..number.." by "..ticker)
else
barbossa = 1
end
StartTimer()
end
function OnTimer()
SendA(Bot,"***Failed to input correct answer")
StopTimer()
StartBot(level)
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "m.start" then
if LogedIn[user.sName] == nil then
SendA(Bot,"you must be first logged in")
return 1
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if level == nil then
SendA(Bot,"remember to select a level m.start ")
return 1
else
SendA(Bot,"[Magic] has been started")
StartBot(level)
return 1
end
end
elseif cmd == "m.login" then
if LogedIn[user.sName] == 1 then
user:SendData(Bot,"You can't log in twice :P")
return 1
else
user:SendData(Bot,"You have succesfully logged into [Magic]")
LogedIn[user.sName] = 1
points[user.sName] = ticker
return 1
end
elseif cmd == "m.score" then
user:SendData(Bot,points[user.sName])
return 1
elseif cmd == "a" then
if LogedIn[user.sName] == 1 then
s,e,answer = strfind(data,"%b<>%s+(%S+)")
if not answer == barbossa then
SendA(Bot,"Incorrect")
if points[user.sName] < erasepoints then
user:SendPM(Bot,"You have zero score so i cant take points away from u, so i will disconnect you instead :P")
user:Disconnect()
else
points[user.sName] = points[user.sName] - erasepoints
end
else
SendA(Bot,"***"..user.sName.." scores "..ticker.." point(s)")
points[user.sName] = points[user.sName] + ticker
StopTimer()
StartBot(level)
end
end
end
end
end
fixed a little arithmetic error
--[Magic]
--v0.57 [Magic] Written by Phatty
--Catagory[Games]
--This is a pre-release, so you will see a lot of changes very soon, such as saving the score
LogedIn = {}
points = {}
erasepoints = 3
function Main()
SendA = SendToAll
Bot = "[Magic]"
DrainFusion()
end
function DrainFusion()
number = random(5)
if number == 1 then
SendA(Bot,"Scripts have been rebooted")
elseif number == 2 then
SendA(Bot,"Warning scripts restarted")
elseif number == 3 then
SendA(Bot,"It's all [Magic] when scripts restart")
elseif number == 4 then
SendA(Bot,"Why do these scripts keep restarting")
elseif number == 5 then
SendA(Bot,"Will you stop restarting scripts :P")
end
SetTimer(2*65432)
end
function StartBot(level)
if level == "1" then
difficulty = "easy"
ticker = random(3)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendA(Bot,"[Magic] is set to "..difficulty)
Find(ticker)
end
function Find(ticker)
number = random(600)
--SendA(Bot,number.." x "..ticker)
killer = random(4)
Translate(killer)
end
function Translate(killer)
if killer == 1 then
barbossa = number + ticker
SendA(Bot,"Add together "..number.." and "..ticker)
elseif killer == 2 then
barbossa = number - ticker
SendA(Bot,"Subtract "..number.." from "..ticker)
elseif killer == 3 then
barbossa = number / ticker
SendA(Bot,"Divide "..number.." by "..ticker)
elseif killer == 4 then
barbossa = number * ticker
SendA(Bot,"Multiply "..number.." by "..ticker)
else
barbossa = 1
end
SendA(Bot,"Answer = "..barbossa)
StartTimer()
end
function OnTimer()
SendA(Bot,"***Failed to input correct answer")
StopTimer()
StartBot(level)
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "m.start" then
if LogedIn[user.sName] == nil then
SendA(Bot,"you must be first logged in")
return 1
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if level == nil then
SendA(Bot,"remember to select a level m.start ")
return 1
else
SendA(Bot,"[Magic] has been started")
StartBot(level)
return 1
end
end
elseif cmd == "m.login" then
if LogedIn[user.sName] == 1 then
user:SendData(Bot,"You can't log in twice :P")
return 1
else
user:SendData(Bot,"You have succesfully logged into [Magic]")
LogedIn[user.sName] = 1
points[user.sName] = ticker
return 1
end
elseif cmd == "m.score" then
user:SendData(Bot,points[user.sName])
return 1
elseif cmd == "a" then
if LogedIn[user.sName] == 1 then
s,e,answer = strfind(data,"%b<>%s+(%S+)")
if not answer == barbossa then
SendA(Bot,"Incorrect")
if points[user.sName] < erasepoints then
user:SendPM(Bot,"You have zero score so i cant take points away from u, so i will disconnect you instead :P")
user:Disconnect()
else
points[user.sName] = points[user.sName] - erasepoints
end
else
SendA(Bot,"***"..user.sName.." scores "..ticker.." point(s)")
if points[user.sName] == nil or points[user.sName] == 0 then
points[user.sName] = ticker
else
points[user.sName] = points[user.sName] + ticker
end
StopTimer()
StartBot(level)
end
end
end
end
end
now heer is a nice little extra whilst i work on some more
--[Magic]
--v0.70 [Magic] Written by Phatty
--Catagory[Games]
LogedIn = {}
points = {}
erasepoints = 3
Fuxion = "timebased"
function Main()
SendA = SendToAll
Bot = "[Magic]"
DrainFusion()
end
function DrainFusion()
number = random(5)
if number == 1 then
SendA(Bot,"Scripts have been rebooted")
elseif number == 2 then
SendA(Bot,"Warning scripts restarted")
elseif number == 3 then
SendA(Bot,"It's all [Magic] when scripts restart")
elseif number == 4 then
SendA(Bot,"Why do these scripts keep restarting")
elseif number == 5 then
SendA(Bot,"Will you stop restarting scripts :P")
end
end
function FusionStart(level)
if Fuxion == "timebased" then
FusionStartb(level)
return 1
else
SetTimer(1*65432)
if level == "1" then
difficulty = "easy"
ticker = random(3)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendA(Bot,"[Magic] is set to "..difficulty)
Find(ticker)
end
end
function FusionStartb(level)
if level == "1" then
difficulty = "easy"
ticker = random(3)
SetTimer(1*30000)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
SetTimer(1*35000)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
SetTimer(1*60000)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
SetTimer(1*60000)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendA(Bot,"[Magic] is set to "..difficulty)
Find(ticker)
end
function Find(ticker)
number = random(600)
--SendA(Bot,number.." x "..ticker)
killer = random(4)
Translate(killer)
end
function Translate(killer)
if killer == 1 then
barbossa = number + ticker
SendA(Bot,"Add together "..number.." and "..ticker)
elseif killer == 2 then
barbossa = number - ticker
SendA(Bot,"Subtract "..number.." from "..ticker)
elseif killer == 3 then
barbossa = number / ticker
SendA(Bot,"Divide "..number.." by "..ticker)
elseif killer == 4 then
barbossa = number * ticker
SendA(Bot,"Multiply "..number.." by "..ticker)
else
barbossa = 1
end
SendA(Bot,"Answer = "..barbossa)
StartTimer()
end
function OnTimer()
SendA(Bot,"***Failed to input correct answer")
StopTimer()
FusionStart(level)
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "m.start" then
if LogedIn[user.sName] == nil then
SendA(Bot,"you must be first logged in")
return 1
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if level == nil then
SendA(Bot,"remember to select a level m.start ")
return 1
else
SendA(Bot,"[Magic] has been started")
FusionStart(level)
return 1
end
end
elseif cmd == "m.login" then
if LogedIn[user.sName] == 1 then
user:SendData(Bot,"You can't log in twice :P")
return 1
else
user:SendData(Bot,"You have succesfully logged into [Magic]")
LogedIn[user.sName] = 1
points[user.sName] = ticker
return 1
end
elseif cmd == "m.score" then
user:SendData(Bot,points[user.sName])
return 1
elseif cmd == "a" then
if LogedIn[user.sName] == 1 then
s,e,answer = strfind(data,"%b<>%s+(%S+)")
if not answer == barbossa then
SendA(Bot,"Incorrect")
if points[user.sName] < erasepoints then
user:SendPM(Bot,"You have zero score so i cant take points away from u, so i will disconnect you instead :P")
user:Disconnect()
else
points[user.sName] = points[user.sName] - erasepoints
end
else
SendA(Bot,"***"..user.sName.." scores "..ticker.." point(s)")
if points[user.sName] == nil or points[user.sName] == 0 then
points[user.sName] = ticker
else
points[user.sName] = points[user.sName] + ticker
end
StopTimer()
StartBot(level)
end
end
end
end
end
some more added
--[Magic]
--v0.71 [Magic] Written by Phatty
--Catagory[Games]
LogedIn = {}
points = {}
erasepoints = 3
Fuxion = "timebased"
function Main()
SendA = SendToAll
Bot = "[Magic]"
frmHub:RegBot(Bot)
DrainFusion()
dVersion = "v0.71"
end
function DrainFusion()
local number = random(5)
if number == 1 then
SendA(Bot,"Scripts have been rebooted")
elseif number == 2 then
SendA(Bot,"Warning scripts restarted")
elseif number == 3 then
SendA(Bot,"It's all [Magic] when scripts restart")
elseif number == 4 then
SendA(Bot,"Why do these scripts keep restarting")
elseif number == 5 then
SendA(Bot,"Will you stop restarting scripts :P")
end
end
function FusionStart(level)
if Fuxion == "timebased" then
FusionStartb(level)
return 1
else
SetTimer(1*65432)
if level == "1" then
difficulty = "easy"
ticker = random(3)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendA(Bot,"[Magic] is set to "..difficulty)
Find(ticker)
end
end
function FusionStartb(level)
if level == "1" then
difficulty = "easy"
ticker = random(3)
SetTimer(1*30000)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
SetTimer(1*35000)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
SetTimer(1*60000)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
SetTimer(1*60000)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendA(Bot,"[Magic] is set to "..difficulty)
Find(ticker)
end
function Find(ticker)
number = random(600)
--SendA(Bot,number.." x "..ticker)
killer = random(4)
Translate(killer)
end
function Translate(killer)
if killer == 1 then
barbossa = number + ticker
SendA(Bot,"Add together "..number.." and "..ticker)
elseif killer == 2 then
barbossa = number - ticker
SendA(Bot,"Subtract "..number.." from "..ticker)
elseif killer == 3 then
barbossa = number / ticker
SendA(Bot,"Divide "..number.." by "..ticker)
elseif killer == 4 then
barbossa = number * ticker
SendA(Bot,"Multiply "..number.." by "..ticker)
else
--On Error resume next
barbossa = 1
end
--SendA(Bot,"Answer = "..barbossa)
StartTimer()
end
function OnTimer()
local number = random(5)
if number == 1 then
SendA(Bot,"***Failed to input correct answer")
elseif number == 2 then
SendA(Bot,"***No one was clever to get that answer")
elseif number == 3 then
SendA(Bot,"***You all are useless morons")
elseif number == 4 then
SendA(Bot,"***You bunch of MUPPETS!!!")
elseif number == 5 then
SendA(Bot,"***Useless sods")
end
StopTimer()
FusionStart(level)
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "m.start" then
if LogedIn[user.sName] == nil then
SendA(Bot,"you must be first logged in")
return 1
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if level == nil then
SendA(Bot,"remember to select a level m.start ")
return 1
else
SendA(Bot,"[Magic] has been started")
FusionStart(level)
return 1
end
end
elseif cmd == "m.login" then
if LogedIn[user.sName] == 1 then
user:SendData(Bot,"You can't log in twice :P")
return 1
else
user:SendData(Bot,"You have succesfully logged into [Magic]")
LogedIn[user.sName] = 1
points[user.sName] = ticker
return 1
end
elseif cmd == "m.score" then
user:SendData(Bot,points[user.sName])
return 1
elseif cmd == "m.version" then
SendA("---------====================================================================------")
SendA(Bot,"../// This Hub is running [Magic] "..dVersion.." written and released by Phatty\\\..")
SendA("---------====================================================================------")
return 1
elseif cmd == "a" then
if LogedIn[user.sName] == 1 then
s,e,answer = strfind(data,"%b<>%s+(%S+)")
if not answer == barbossa then
SendA(Bot,"Incorrect")
if points[user.sName] < erasepoints then
user:SendPM(Bot,"You have zero score so i cant take points away from u, so i will disconnect you instead :P")
user:Disconnect()
else
points[user.sName] = points[user.sName] - erasepoints
end
else
SendA(Bot,"***"..user.sName.." scores "..ticker.." point(s)")
if points[user.sName] == nil or points[user.sName] == 0 then
points[user.sName] = ticker
else
points[user.sName] = points[user.sName] + ticker
end
StopTimer()
FusionStart(level)
end
else
user:SendData(Bot,"Please login first, type m.help")
return 1
end
end
end
end
hmm can you tell im bored and sick of writing my G-Engine lol
Tell me, what this script for? What does it doing?
I'm don't know LUA languadge, so it's difficult to me understand it from source..
My english is too bad?
for those that do not know lua, just w8 until the version actual release these are pre releases, they actaully dont work properly, im sorting a few things, but gong for some sleep now so l8rr,, ;)
:P elo Mmmm ...this script looks really easy but im finding it strange... cant get the help to work.. it wont take my answers. nothing works for me :(.. you can login...select the level then nothing :( i havent changed a thing so can u tell me wot im doing wrong please...i really like this script ?(
ps......Dont sleep for too long.. :P :P :P
whoa i forgot about this lol, i forgot to release a working version, i guess im gonna have to finish it sometime ;-)
:P Nice decision.... i hope *sometime* is Reeeeaally soon :P :P :P id luv to see this working :]
ok quick and untested
--[Magic]
--v0.80 [Magic] by [?K?]Ph?TT?
--Catagory[Games]
_usertbl = {}
erasepoints = 3
Status = 2
function Main()
BOT = "[Magic]"
frmHub:RegBot(BOT)
RandStart()
dVersion = "v0.80"
end
function RandStart()
local randomstart = {
"Scripts have been rebooted",
"Warning scripts restarted",
"It's all [Magic] when scripts restart",
"Why do these scripts keep restarting",
"Will you stop restarting scripts :P",
}
local tableref = randomstart[random(1,getn(randomstart))]
SendToAll(BOT,tableref)
end
function MagicStart(level)
if Status == 1 then
MagicStartb(level)
return 1
else
SetTimer(1*65432)
if level == "1" then
difficulty = "easy"
ticker = random(3)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendToAll(BOT,"[Magic] is set to "..difficulty)
Find(ticker)
end
end
function MagicStartb(level)
if level == "1" then
difficulty = "easy"
ticker = random(3)
SetTimer(1*30000)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
SetTimer(1*35000)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
SetTimer(1*60000)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
SetTimer(1*60000)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendToAll(BOT,"[Magic] is set to "..difficulty)
Find(ticker)
end
function Find(ticker)
number = random(600)
--SendA(Bot,number.." x "..ticker)
ticnum = random(4)
ShowSum(ticnum)
end
function ShowSum(ticnum)
if ticnum == 1 then
answer = number + ticker
SendToAll(BOT,"Add together "..number.." and "..ticker)
elseif ticnum == 2 then
answer = number - ticker
SendToAll(BOT,"Subtract "..number.." from "..ticker)
elseif ticnum == 3 then
answer = number / ticker
SendToAll(BOT,"Divide "..number.." by "..ticker)
elseif ticnum == 4 then
answer = number * ticker
SendToAll(BOT,"Multiply "..number.." by "..ticker)
else
answer = 1
end
SendToAll(BOT,"Answer = "..answer)
StartTimer()
end
function OnTimer()
StopTimer()
local insult = {
"***Failed to input correct answer",
"***No one was clever to get that answer",
"***You all are useless morons",
"***You bunch of MUPPETS!!!",
"***Useless sods",
}
local tableref = insult[random(1,getn(insult))]
SendToAll(BOT,tableref)
MagicStart(level)
end;
--tinsert()
--tremove()
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
local s,e,cmd = strfind(data,"%b<>%s+(%S+)")
local prefix = "m."
if cmd == prefix.."start" then
if not _usertbl[user.sName] then
SendToAll(BOT,"You must be first logged in")
return 1;
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%d+)")
if level == nil then
user:SendData(BOT,"remember to select a level m.start ")
return 1
else
SendToAll(BOT,"[Magic] has been started")
MagicStart(level)
return 1
end
end
elseif cmd == prefix.."login" then
if _usertbl[user.sName] then
user:SendData(BOT,"You can't log in twice :P")
return 1
else
user:SendData(BOT,"You have succesfully logged into [Magic]")
_usertbl[user.sName] = {}
_usertbl[user.sName][2] = 0;
return 1
end
elseif cmd == prefix.."score" then
user:SendData(BOT,_usertbl[user.sName][2])
return 1
elseif cmd == prefix.."version" then
SendToAll("---------====================================================================------")
SendToAll(BOT,"../// This Hub is running [Magic] "..dVersion.." written and released by Phatty\\\..")
SendToAll("---------====================================================================------")
return 1
elseif cmd == "a" then
if _usertbl[user.sName] then
local s,e,cmd,ans = strfind(data,"%b<>%s+(%S+)%s+(%d+)")
if ans ~= answer then
SendToAll(BOT,"Incorrect")
if _usertbl[user.sName][2] < erasepoints then
user:SendData(BOT,"You don't have enough score to play, so i will disconnect you instead :P")
user:Disconnect()
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] - erasepoints
end
else
SendToAll(BOT,"***"..user.sName.." scores "..ticker.." point(s)")
if _usertbl[user.sName][2] == nil or _usertbl[user.sName][2] == 0 then
_usertbl[user.sName][2] = ticker
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] + ticker
end
StopTimer()
MagicStart(level)
end
else
user:SendData(BOT,"Please login first, type "..prefix.."help")
return 1
end
end
end
end
ok quick rundown....m.login fine...m.start 1 fine..the equasion comes out.. but has the answer too....m.help doesnt work ...and i cant switch it off :rolleyes:
QuoteOriginally posted by (uk-kingdom)pH?tt?
ok quick and untested
--[Magic]
--v0.80 [Magic] by [?K?]Ph?TT?
--Catagory[Games]
_usertbl = {}
erasepoints = 3
Status = 2
function Main()
BOT = "[Magic]"
frmHub:RegBot(BOT)
RandStart()
dVersion = "v0.80"
end
function RandStart()
local randomstart = {
"Scripts have been rebooted",
"Warning scripts restarted",
"It's all [Magic] when scripts restart",
"Why do these scripts keep restarting",
"Will you stop restarting scripts :P",
}
local tableref = randomstart[random(1,getn(randomstart))]
SendToAll(BOT,tableref)
end
function MagicStart(level)
if Status == 1 then
MagicStartb(level)
return 1
else
SetTimer(1*65432)
if level == "1" then
difficulty = "easy"
ticker = random(3)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendToAll(BOT,"[Magic] is set to "..difficulty)
Find(ticker)
end
end
function MagicStartb(level)
if level == "1" then
difficulty = "easy"
ticker = random(3)
SetTimer(1*30000)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
SetTimer(1*35000)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
SetTimer(1*60000)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
SetTimer(1*60000)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendToAll(BOT,"[Magic] is set to "..difficulty)
Find(ticker)
end
function Find(ticker)
number = random(600)
--SendA(Bot,number.." x "..ticker)
ticnum = random(4)
ShowSum(ticnum)
end
function ShowSum(ticnum)
if ticnum == 1 then
answer = number + ticker
SendToAll(BOT,"Add together "..number.." and "..ticker)
elseif ticnum == 2 then
answer = number - ticker
SendToAll(BOT,"Subtract "..number.." from "..ticker)
elseif ticnum == 3 then
answer = number / ticker
SendToAll(BOT,"Divide "..number.." by "..ticker)
elseif ticnum == 4 then
answer = number * ticker
SendToAll(BOT,"Multiply "..number.." by "..ticker)
else
answer = 1
end
SendToAll(BOT,"Answer = "..answer)
StartTimer()
end
function OnTimer()
StopTimer()
local insult = {
"***Failed to input correct answer",
"***No one was clever to get that answer",
"***You all are useless morons",
"***You bunch of MUPPETS!!!",
"***Useless sods",
}
local tableref = insult[random(1,getn(insult))]
SendToAll(BOT,tableref)
MagicStart(level)
end;
--tinsert()
--tremove()
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
local s,e,cmd = strfind(data,"%b<>%s+(%S+)")
local prefix = "m."
if cmd == prefix.."start" then
if not _usertbl[user.sName] then
SendToAll(BOT,"You must be first logged in")
return 1;
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%d+)")
if level == nil then
user:SendData(BOT,"remember to select a level m.start ")
return 1
else
SendToAll(BOT,"[Magic] has been started")
MagicStart(level)
return 1
end
end
elseif cmd == prefix.."login" then
if _usertbl[user.sName] then
user:SendData(BOT,"You can't log in twice :P")
return 1
else
user:SendData(BOT,"You have succesfully logged into [Magic]")
_usertbl[user.sName] = {}
_usertbl[user.sName][2] = 0;
return 1
end
elseif cmd == prefix.."score" then
user:SendData(BOT,_usertbl[user.sName][2])
return 1
elseif cmd == prefix.."version" then
SendToAll("---------====================================================================------")
SendToAll(BOT,"../// This Hub is running [Magic] "..dVersion.." written and released by Phatty\\\..")
SendToAll("---------====================================================================------")
return 1
elseif cmd == "a" then
if _usertbl[user.sName] then
local s,e,cmd,ans = strfind(data,"%b<>%s+(%S+)%s+(%d+)")
if ans ~= answer then
SendToAll(BOT,"Incorrect")
if _usertbl[user.sName][2] < erasepoints then
user:SendData(BOT,"You don't have enough score to play, so i will disconnect you instead :P")
user:Disconnect()
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] - erasepoints
end
else
SendToAll(BOT,"***"..user.sName.." scores "..ticker.." point(s)")
if _usertbl[user.sName][2] == nil or _usertbl[user.sName][2] == 0 then
_usertbl[user.sName][2] = ticker
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] + ticker
end
StopTimer()
MagicStart(level)
end
else
user:SendData(BOT,"Please login first, type "..prefix.."help")
return 1
end
end
end
end
Nice [MAGIC] work on this script ! :D
its for debug purposes
function ShowSum(ticnum)
if ticnum == 1 then
answer = number + ticker
SendToAll(BOT,"Add together "..number.." and "..ticker)
elseif ticnum == 2 then
answer = number - ticker
SendToAll(BOT,"Subtract "..number.." from "..ticker)
elseif ticnum == 3 then
answer = number / ticker
SendToAll(BOT,"Divide "..number.." by "..ticker)
elseif ticnum == 4 then
answer = number * ticker
SendToAll(BOT,"Multiply "..number.." by "..ticker)
else
answer = 1
end
--SendToAll(BOT,"Answer = "..answer)
StartTimer()
end
no more answer
ther is no switch off, i will add soon for f-release and ther aint help yet which i will also add
still untested
--[Magic]
--v0.81 [Magic] by [?K?]Ph?TT?
--Catagory[Games]
_usertbl = {}
erasepoints = 3
Status = 2
function Main()
BOT = "[Magic]"
frmHub:RegBot(BOT)
RandStart()
dVersion = "v0.80"
end
function RandStart()
local randomstart = {
"Scripts have been rebooted",
"Warning scripts restarted",
"It's all [Magic] when scripts restart",
"Why do these scripts keep restarting",
"Will you stop restarting scripts :P",
}
local tableref = randomstart[random(1,getn(randomstart))]
SendToAll(BOT,tableref)
end
function MagicStart(level)
if Status == 1 then
MagicStartb(level)
return 1
else
SetTimer(1*65432)
if level == "1" then
difficulty = "easy"
ticker = random(3)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendToAll(BOT,"[Magic] is set to "..difficulty)
Find(ticker)
end
end
function MagicStartb(level)
if level == "1" then
difficulty = "easy"
ticker = random(3)
SetTimer(1*30000)
elseif level == "2" then
difficulty = "mediam"
ticker = random(10)
SetTimer(1*35000)
elseif level == "3" then
difficulty = "hard"
ticker = random(20)
SetTimer(1*60000)
elseif level == "4" then
difficulty = "unstopable"
ticker = random(60)
SetTimer(1*60000)
--else
--difficulty = "random"
--nr = random(4)
--level = nr
--StartBot(level)
end
SendToAll(BOT,"[Magic] is set to "..difficulty)
Find(ticker)
end
function Find(ticker)
number = random(600)
--SendA(Bot,number.." x "..ticker)
ticnum = random(4)
ShowSum(ticnum)
end
function ShowSum(ticnum)
if ticnum == 1 then
answer = number + ticker
SendToAll(BOT,"Add together "..number.." and "..ticker)
elseif ticnum == 2 then
answer = number - ticker
SendToAll(BOT,"Subtract "..number.." from "..ticker)
elseif ticnum == 3 then
answer = number / ticker
SendToAll(BOT,"Divide "..number.." by "..ticker)
elseif ticnum == 4 then
answer = number * ticker
SendToAll(BOT,"Multiply "..number.." by "..ticker)
else
answer = 1
end
StartTimer()
end
function OnTimer()
StopTimer()
local insult = {
"***Failed to input correct answer",
"***No one was clever to get that answer",
"***You all are useless morons",
"***You bunch of MUPPETS!!!",
"***Useless sods",
}
local tableref = insult[random(1,getn(insult))]
SendToAll(BOT,tableref)
MagicStart(level)
end;
--tinsert()
--tremove()
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
local s,e,cmd = strfind(data,"%b<>%s+(%S+)")
local prefix = "m."
if cmd == prefix.."start" then
if not _usertbl[user.sName] then
SendToAll(BOT,"You must be first logged in")
return 1;
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%d+)")
if level == nil then
user:SendData(BOT,"remember to select a level m.start ")
return 1
else
SendToAll(BOT,"[Magic] has been started")
MagicStart(level)
return 1
end
end
elseif cmd == prefix.."stop" then
StopTimer()
SendToAll(BOT,"[Magic] has been stopped")
elseif cmd == prefix.."login" then
if _usertbl[user.sName] then
user:SendData(BOT,"You can't log in twice :P")
return 1
else
user:SendData(BOT,"You have succesfully logged into [Magic]")
_usertbl[user.sName] = {}
_usertbl[user.sName][2] = 0;
return 1
end
elseif cmd == prefix.."score" then
user:SendData(BOT,_usertbl[user.sName][2])
return 1
elseif cmd == prefix.."version" then
SendToAll("---------====================================================================------")
SendToAll(BOT,"../// This Hub is running [Magic] "..dVersion.." written and released by Phatty\\\..")
SendToAll("---------====================================================================------")
return 1
elseif cmd == prefix.."help" then
user:SendData(BOT,"Not Implemented yet lol")
elseif cmd == "a" then
if _usertbl[user.sName] then
local s,e,cmd,ans = strfind(data,"%b<>%s+(%S+)%s+(%d+)")
if ans ~= answer then
SendToAll(BOT,"Incorrect")
if _usertbl[user.sName][2] < erasepoints then
user:SendData(BOT,"You don't have enough score to play, so i will disconnect you instead :P")
user:Disconnect()
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] - erasepoints
end
else
SendToAll(BOT,"***"..user.sName.." scores "..ticker.." point(s)")
if _usertbl[user.sName][2] == nil or _usertbl[user.sName][2] == 0 then
_usertbl[user.sName][2] = ticker
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] + ticker
end
StopTimer()
MagicStart(level)
end
else
user:SendData(BOT,"Please login first, type "..prefix.."help")
return 1
end
end
end
end
Plz Plz Plz Plz Plz Plz Plz finish this bot phatty.. U know u want to.. :P :P :P :P :P :P i tested it... just wont take the answers and ur help file needs implemented :P:P:P:P other than that its fine .. i await with anticipation :D :D :D
;) OK all the scripters out there lets see who can fix this bot i waited aaaaaaaaaaaaaaaaaages on U know who to do it but hes busy for now soooooooooo plz plz plz plz someone make it work for me ty ty ty ty:D :D :D
Lets hope Phatty wont ban me from the Forums .. lol
--[Magic]
-----------------------------------------------------------------
--v0.71 [Magic] Written by Phatty
--Catagory[Games]
-----------------------------------------------------------------
--- v.072 touched by Herodes 6/8 - 2004
--- Same Category .. :)
-----------------------------------------------------------------
LogedIn = {}
points = {}
erasepoints = 3
Fuxion = "timebased"
function Main()
Bot = "[Magic]"
frmHub:UnregBot(Bot)
frmHub:RegBot(Bot)
DrainFusion()
dVersion = "v0.72"
end
function DrainFusion()
restartans = {
[1] = "Scripts have been rebooted",
[2] = "Warning scripts restarted",
[3] = "It's all [Magic] when scripts restart",
[4] = "Why do these scripts keep restarting",
[5] = "Will you stop restarting scripts :P",
};
SendToAll( Bot, restartans[random(getn(restartans))])
restartans = nil
end
function FusionStart(level)
if (Fuxion == "timebased") then
FusionStartb(level)
return 1
else
SetTimer(1*65432)
lvl = {
[1] = { [1] = "easy", [2] = random(3) },
[2] = { [1] = "medium", [2] = random(10) },
[3] = { [1] = "hard", [2] = random(20) },
[4] = { [1] = "unstoppable", [2] = random(60) },
};
if lvl[tonumber(level)] then
SendToAll(Bot,"[Magic] is set to "..lvl[tonumber(level)][1])
ticker = lvl[tonumber(level)][2]
Find(ticker)
lvl = nil
else SendToAll(Bot, "The level has to be between 1 and 4 ..." )
end
end
end
function FusionStartb(level)
lvl = {
[1] = { [1] = "easy", [2] = random(3), [3] = 30000, },
[2] = { [1] = "medium", [2] = random(10), [3] = 35000, },
[3] = { [1] = "hard", [2] = random(20), [3] = 60000, },
[4] = { [1] = "unstoppable", [2] = random(60), [3] = 60000, },
};
if lvl[tonumber(level)] then
SendToAll(Bot,"[Magic] is set to "..lvl[tonumber(level)][1])
ticker = lvl[tonumber(level)][2]
SetTimer(lvl[tonumber(level)][3])
Find(ticker)
lvl = nil
else SendToAll(Bot, "The level has to be between 1 and 4 ..." )
end
end
function Find(ticker)
number = random(600)
--SendToAll(Bot,number.." x "..ticker)
killer = random(4)
Translate(killer)
end
function Translate(killer)
operation = {
[1] = { [1] = number + ticker, [2] = "Add together "..number.." and "..ticker, },
[2] = { [1] = number - ticker, [2] = "Subtract "..number.." from "..ticker, },
[3] = { [1] = number / ticker, [2] = "Divide "..number.." by "..ticker, },
[4] = { [1] = number * ticker, [2] = "Multiply "..number.." by "..ticker, },
};
barbossa = operation[tonumber(killer)][1]
SendToAll(Bot, operation[tonumber(killer)][2])
SendToAll(Bot,"Answer = "..barbossa)
StartTimer()
end
function OnTimer()
Wrong()
StopTimer()
FusionStart(level)
end
function Wrong()
waitingans = {
[1] = "***Failed to input correct answer",
[2] = "***No one was clever to get that answer",
[3] = "***You all are useless morons",
[4] = "***You bunch of MUPPETS!!!",
[5] = "***Useless sods",
};
SendToAll( Bot, waitingans[random(getn(waitingans))])
waitingans = nil
end
function DataArrival(user,data)
if (strsub(data, 1, 1) == "<") then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd == "m.start") then
if (LogedIn[user.sName] == nil) then
SendToAll(Bot,"you must be first logged in")
return 1
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if (level == nil) then
SendToAll(Bot,"remember to select a level m.start ")
return 1
else
SendToAll(Bot,"[Magic] has been started")
FusionStart(level)
return 1
end
end
elseif (cmd == "m.login") then
if (LogedIn[user.sName] == 1) then
user:SendData(Bot,"You can't log in twice :P")
return 1
else
user:SendData(Bot,"You have succesfully logged into [Magic]")
LogedIn[user.sName] = 1
points[user.sName] = ticker
return 1
end
elseif (cmd == "m.score") then
user:SendData(Bot, points[user.sName])
return 1
elseif (cmd == "m.version") then
SendToAll("---------=========================================================------")
SendToAll(Bot,"../// This Hub is running Phatty's [Magic] "..dVersion.." ( Herodes remix ) \\\..")
SendToAll("---------=========================================================------")
return 1
elseif (cmd == "a") then
if (LogedIn[user.sName] == 1) then
s,e,answer = strfind(data,"%b<>%sa%s(%S+)")
if (tonumber(answer) ~= barbossa) then
SendToAll(Bot,"Incorrect")
if ( points[user.sName] < erasepoints ) then
user:SendPM(Bot,"You have zero score so i cant take points away from u, so i will disconnect you instead :P")
user:Disconnect()
else points[user.sName] = points[user.sName] - erasepoints
end
else
SendToAll(Bot,"***"..user.sName.." scores "..ticker.." point(s)")
if ((points[user.sName] == nil) or (points[user.sName] == 0)) then points[user.sName] = ticker
else points[user.sName] = points[user.sName] + ticker
end
SendToAll(Bot, "Now, "..user.sName.." has "..points[user.sName].." points")
StopTimer()
FusionStart(level)
end
else
user:SendData(Bot,"Please login first, type m.help")
return 1
end
end
end
end
Thanks to Phatty for the idea I hope its error free ...
as far as I tested it was .. enjoy and learn math with this nice bot .. :)
Nice 1 Herodes
and if phatty bans ya il give him a slap , mmm 2nd thorughts he might like that LMAO
yours shad :D
I talked to phatty. He doesnt mind someone fixing it..I have it running the answers are there too X( when i start the game : X(
<[Magic]> ***You all are useless morons
<[Magic]> [Magic] is set to easy
<[Magic]> Subtract 87 from 1
<[Magic]> Answer = 86
So i cant type in the answer cause its already there X( Also its disconnecting X( Needs a stop function too :)
ello
hope heodes dosent mind me moding it a little :)
try this
--[Magic]
-----------------------------------------------------------------
--v0.71 [Magic] Written by Phatty
--Catagory[Games]
-----------------------------------------------------------------
--- v.072 touched by Herodes 6/8 - 2004
--- Same Category .. :)
-----------------------------------------------------------------
--- v.072 fix by Shad_dow 6/8 - 2004 12:03 pm
--- Same Category .. :)
--- added help and stop functions
--- all credauts to phatty and Herodes
--- debug bit comment out :) - --SendToAll(Bot,"Answer = "..barbossa)
-----------------------------------------------------------------
LogedIn = {}
points = {}
erasepoints = 3
Fuxion = "timebased"
function Main()
Bot = "[Magic]"
frmHub:RegBot(Bot)
frmHub:UnregBot(Bot)
DrainFusion()
dVersion = "v0.72"
end
function DrainFusion()
restartans = {
[1] = "Scripts have been rebooted",
[2] = "Warning scripts restarted",
[3] = "It's all [Magic] when scripts restart",
[4] = "Why do these scripts keep restarting",
[5] = "Will you stop restarting scripts :P",
};
SendToAll( Bot, restartans[random(getn(restartans))])
restartans = nil
end
function FusionStart(level)
if (Fuxion == "timebased") then
FusionStartb(level)
return 1
else
SetTimer(1*65432)
lvl = {
[1] = { [1] = "easy", [2] = random(3) },
[2] = { [1] = "medium", [2] = random(10) },
[3] = { [1] = "hard", [2] = random(20) },
[4] = { [1] = "unstoppable", [2] = random(60) },
};
if lvl[tonumber(level)] then
SendToAll(Bot,"[Magic] is set to "..lvl[tonumber(level)][1])
ticker = lvl[tonumber(level)][2]
Find(ticker)
lvl = nil
else SendToAll(Bot, "The level has to be between 1 and 4 ..." )
end
end
end
function FusionStartb(level)
lvl = {
[1] = { [1] = "easy", [2] = random(3), [3] = 30000, },
[2] = { [1] = "medium", [2] = random(10), [3] = 35000, },
[3] = { [1] = "hard", [2] = random(20), [3] = 60000, },
[4] = { [1] = "unstoppable", [2] = random(60), [3] = 60000, },
};
if lvl[tonumber(level)] then
SendToAll(Bot,"[Magic] is set to "..lvl[tonumber(level)][1])
ticker = lvl[tonumber(level)][2]
SetTimer(lvl[tonumber(level)][3])
Find(ticker)
lvl = nil
else SendToAll(Bot, "The level has to be between 1 and 4 ..." )
end
end
function Find(ticker)
number = random(600)
--SendToAll(Bot,number.." x "..ticker)
killer = random(4)
Translate(killer)
end
function Translate(killer)
operation = {
[1] = { [1] = number + ticker, [2] = "Add together "..number.." and "..ticker, },
[2] = { [1] = number - ticker, [2] = "Subtract "..number.." from "..ticker, },
[3] = { [1] = number / ticker, [2] = "Divide "..number.." by "..ticker, },
[4] = { [1] = number * ticker, [2] = "Multiply "..number.." by "..ticker, },
};
barbossa = operation[tonumber(killer)][1]
SendToAll(Bot, operation[tonumber(killer)][2])
--SendToAll(Bot,"Answer = "..barbossa)
StartTimer()
end
function OnTimer()
Wrong()
StopTimer()
FusionStart(level)
end
function Wrong()
waitingans = {
[1] = "***Failed to input correct answer",
[2] = "***No one was clever to get that answer",
[3] = "***You all are useless morons",
[4] = "***You bunch of MUPPETS!!!",
[5] = "***Useless sods",
};
SendToAll( Bot, waitingans[random(getn(waitingans))])
waitingans = nil
end
function DataArrival(user,data)
if (strsub(data, 1, 1) == "<") then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd == "m.start") then
if (LogedIn[user.sName] == nil) then
SendToAll(Bot,"you must be first logged in")
return 1
else
s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if (level == nil) then
SendToAll(Bot,"remember to select a level m.start ")
return 1
else
SendToAll(Bot,"[Magic] has been started")
FusionStart(level)
return 1
end
end
elseif (cmd == "m.stop") then
StopTimer()
SendToAll(Bot,"[Magic] has been stopped")
return 1
elseif (cmd == "m.login") then
if (LogedIn[user.sName] == 1) then
user:SendData(Bot,"You can't log in twice :P")
return 1
else
user:SendData(Bot,"You have succesfully logged into [Magic]")
LogedIn[user.sName] = 1
points[user.sName] = ticker
return 1
end
elseif (cmd == "m.score") then
user:SendData(Bot, points[user.sName])
return 1
elseif (cmd == "m.version") then
SendToAll("---------=========================================================------")
SendToAll(Bot,"../// This Hub is running Phatty's [Magic] "..dVersion.." ( Herodes remix ) \\\..")
SendToAll("---------=========================================================------")
return 1
elseif (cmd == "m.help") then
user:SendData(Bot,"---------====================================================================------")
user:SendData(Bot,"---------=m.login -------------------- Logins u in to magic =------")
user:SendData(Bot,"---------=m.start [Lvevel] ------------- Starts Magic Level 1/2/3 =------")
user:SendData(Bot,"---------=m.stop --------------------- Stops magic =------")
user:SendData(Bot,"---------=m.score -------------------- Shows Score =------")
user:SendData(Bot,"---------=m.version ------------------ Shows Script version =------")
user:SendData(Bot,"---------= a (number) --------------------------- Answer [Example a 676 ] =------")
user:SendData(Bot,"---------=m.help ----------------------- This Help =------")
user:SendData(BOT,"---------====================================================================------")
return 1
elseif (cmd == "a") then
if (LogedIn[user.sName] == 1) then
s,e,answer = strfind(data,"%b<>%sa%s(%S+)")
if (tonumber(answer) ~= barbossa) then
SendToAll(Bot,"Incorrect")
if ( points[user.sName] < erasepoints ) then
user:SendPM(Bot,"You have zero score so i cant take points away from u, so i will disconnect you instead :P")
user:Disconnect()
else points[user.sName] = points[user.sName] - erasepoints
end
else
SendToAll(Bot,"***"..user.sName.." scores "..ticker.." point(s)")
if ((points[user.sName] == nil) or (points[user.sName] == 0)) then points[user.sName] = ticker
else points[user.sName] = points[user.sName] + ticker
end
SendToAll(Bot, "Now, "..user.sName.." has "..points[user.sName].." points")
StopTimer()
FusionStart(level)
end
else
user:SendData(Bot,"Please login first, type m.help")
return 1
end
end
end
end
:] :] :] WELL what can i say ,my post has been in so long and now woooohooooo THATS IT SHAD :P :P im running it now and i think its doing wot its supposed to Well Done U :P and thank you Herodes for ur work too much appreciated guys :P :P :P Great Stuff u Scripters ;)
* Embarressed * yw HellsLittleAngel
yours
shad
:D sighs in contentment....*thinks* a job well done :D
sorry ive not had time lately but hey im back for an hour :D
--[Magic]
-----------------------------------------------------------------
--v0.71 [Magic] Written by Phatty
--Catagory[Games]
-----------------------------------------------------------------
--- v.072 touched by Herodes 6/8 - 2004
--- Same Category .. :)
-----------------------------------------------------------------
--- v.072 fix by Shad_dow 6/8 - 2004 12:03 pm
--- Same Category .. :)
--- added help and stop functions
--- all credauts to phatty and Herodes
--- debug bit comment out :) - --SendToAll(Bot,"Answer = "..barbossa)
-----------------------------------------------------------------
--- v.073 update by Phatty 6:44am 7th Aug
--- cleaned up code ;)
--- just 1 table ;)
--- just back to lua for about an hour today :D
-----------------------------------------------------------------
_usertbl = {}
erasepoints = 3
Status = 2
function Main()
Bot = "[Magic]"
frmHub:RegBot(Bot)
frmHub:UnregBot(Bot)
RandStart()
dVersion = "v0.73"
end
function RandStart()
local randomstart = {
"Scripts have been rebooted",
"Warning scripts restarted",
"It's all [Magic] when scripts restart",
"Why do these scripts keep restarting",
"Will you stop restarting scripts :P",
}
local tableref = randomstart[random(1,getn(randomstart))]
SendToAll(BOT,tableref)
end
function MagicStart(level)
if (Fuxion == 1) then
MagicStartb(level)
return 1;
else
SetTimer(1*65432)
local lvl =
{
[1] = { [1] = "easy", [2] = random(3) },
[2] = { [1] = "medium", [2] = random(10) },
[3] = { [1] = "hard", [2] = random(20) },
[4] = { [1] = "unstoppable", [2] = random(60) },
}
if lvl[tonumber(level)] then
SendToAll(Bot,"[Magic] is set to "..lvl[tonumber(level)][1])
ticker = lvl[tonumber(level)][2]
Find(ticker)
else
SendToAll(Bot, "The level has to be between 1 and 4 ..." )
end;
end;
end;
function MagicStartb(level)
local lvl =
{
[1] = { [1] = "easy", [2] = random(3), [3] = 30000, },
[2] = { [1] = "medium", [2] = random(10), [3] = 35000, },
[3] = { [1] = "hard", [2] = random(20), [3] = 60000, },
[4] = { [1] = "unstoppable", [2] = random(60), [3] = 60000, },
}
if lvl[tonumber(level)] then
SendToAll(Bot,"[Magic] is set to "..lvl[tonumber(level)][1])
ticker = lvl[tonumber(level)][2]
SetTimer(lvl[tonumber(level)][3])
Find(ticker)
else
SendToAll(Bot, "The level has to be between 1 and 4 ..." )
end;
end;
function Find(ticker)
number = random(600)
--SendToAll(Bot,number.." x "..ticker) --debug
killer = random(4)
Translate(killer)
end
function Translate(killer)
local operation = {
[1] = { [1] = number + ticker, [2] = "Add together "..number.." and "..ticker, },
[2] = { [1] = number - ticker, [2] = "Subtract "..number.." from "..ticker, },
[3] = { [1] = number / ticker, [2] = "Divide "..number.." by "..ticker, },
[4] = { [1] = number * ticker, [2] = "Multiply "..number.." by "..ticker, },
}
answer = operation[tonumber(killer)][1]
SendToAll(Bot, operation[tonumber(killer)][2])
StartTimer()
end
function OnTimer()
StopTimer() -- stop timer be4 its too late
local insult = {
"***Failed to input correct answer",
"***No one was clever to get that answer",
"***You all are useless morons",
"***You bunch of MUPPETS!!!",
"***Useless sods",
}
local tableref = insult[random(1,getn(insult))]
SendToAll(BOT,tableref)
MagicStart(level)
end
function DataArrival(user,data)
if (strsub(data, 1, 1) == "<") then
data=strsub(data,1,strlen(data)-1)
local s,e,cmd = strfind(data,"%b<>%s+(%S+)")
local prefix = "m."
if prefix.."start" == cmd then
if not _usertbl[user.sName] then
SendToAll(Bot,"you must be first logged in")
return 1
else
local s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if nil == level then
SendToAll(Bot,"remember to select a level m.start ")
return 1
else
SendToAll(Bot,"[Magic] has been started")
MagicStart(level)
return 1;
end;
end;
elseif prefix.."stop" == cmd then
StopTimer()
SendToAll(Bot,"[Magic] has been stopped")
return 1;
elseif prefix.."login" == cmd then
if 1 == _usertbl[user.sName] then
user:SendData(Bot,"You can't log in twice :P")
return 1;
else
user:SendData(Bot,"You have succesfully logged into [Magic]")
_usertbl[user.sName] = {}
_usertbl[user.sName][2] = 0;
return 1;
end;
elseif prefix.."score" == cmd then
user:SendData(BOT,_usertbl[user.sName][2])
return 1;
elseif prefix.."version" == cmd then
SendToAll("---------=========================================================------")
SendToAll(Bot,"../// This Hub is running Phatty's [Magic] "..dVersion.." ( Herodes remix ) \\\..")
SendToAll("---------=========================================================------")
return 1
elseif prefix.."help" == cmd then
user:SendData(Bot,"---------====================================================================------")
user:SendData(Bot,"---------="..prefix.."login -------------------- Logins u in to magic =------")
user:SendData(Bot,"---------="..prefix.."start [Lvevel] ------------- Starts Magic Level 1/2/3 =------")
user:SendData(Bot,"---------="..prefix.."stop --------------------- Stops magic =------")
user:SendData(Bot,"---------="..prefix.."score -------------------- Shows Score =------")
user:SendData(Bot,"---------="..prefix.."version ------------------ Shows Script version =------")
user:SendData(Bot,"---------= a (number) --------------------------- Answer [Example a 676 ] =------")
user:SendData(Bot,"---------="..prefix.."help ----------------------- This Help =------")
user:SendData(BOT,"---------====================================================================------")
return 1;
elseif "a" == cmd then
if 1 == _usertbl[user.sName] then
local s,e,useranswer = strfind(data,"%b<>%sa%s(%S+)")
if tonumber(useranswer) ~= answer then
SendToAll(Bot,"Incorrect")
if _usertbl[user.sName][2] < erasepoints then
user:SendPM(Bot,"You have zero score so i cant take points away from u, so i will disconnect you instead :P")
user:Disconnect()
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] - erasepoints
end;
else
SendToAll(Bot,"***"..user.sName.." scores "..ticker.." point(s)")
if nil == _usertbl[user.sName][2] or 0 == _usertbl[user.sName][2] then
_usertbl[user.sName][2] = ticker
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] + ticker
end;
SendToAll(Bot, "Now, "..user.sName.." has ".._usertbl[user.sName][2].." points")
StopTimer()
MagicStart(level)
end
else
user:SendData(Bot,"Please login first, type "..prefix.."help")
return 1;
end;
end;
end;
end;
--- [Magic]
-----------------------------------------------------------------
--- v0.71 [Magic] Written by Phatty
--- Catagory[Games]
-----------------------------------------------------------------
--- v.072 touched by Herodes 6/8 - 2004
--- Same Category .. :)
-----------------------------------------------------------------
--- v.072 fix by Shad_dow 6/8 - 2004 12:03 pm
--- Same Category .. :)
--- added help and stop functions
--- all credauts to phatty and Herodes
--- debug bit comment out :) - --SendToAll(Bot,"Answer = "..barbossa)
-----------------------------------------------------------------
--- v.073 update by Phatty 6:44am 7th Aug
--- cleaned up code ;)
--- just 1 table ;)
--- just back to lua for about an hour today :D
-----------------------------------------------------------------
--- v.074 update by Phatty 6:44am 7th Aug
--- Silly mistake fixed ;)
--- save function and command auto save in later ptokax m.save ;)
-----------------------------------------------------------------
filecheckx = openfile("table.txt", "r")
if filecheckx then
assert(dofile("table.txt"))
closefile(filecheckx)
else
Inbox = {}
closefile(filecheckx)
end
_usertbl = {}
erasepoints = 3
Status = 2
function Main()
Bot = "[Magic]"
frmHub:RegBot(Bot)
frmHub:UnregBot(Bot)
RandStart()
dVersion = "v0.73"
end
function RandStart()
local randomstart = {
"Scripts have been rebooted",
"Warning scripts restarted",
"It's all [Magic] when scripts restart",
"Why do these scripts keep restarting",
"Will you stop restarting scripts :P",
}
local tableref = randomstart[random(1,getn(randomstart))]
SendToAll(BOT,tableref)
end
function MagicStart(level)
if (Status == 1) then
MagicStartb(level)
return 1;
else
SetTimer(1*65432)
local lvl =
{
[1] = { [1] = "easy", [2] = random(3) },
[2] = { [1] = "medium", [2] = random(10) },
[3] = { [1] = "hard", [2] = random(20) },
[4] = { [1] = "unstoppable", [2] = random(60) },
}
if lvl[tonumber(level)] then
SendToAll(Bot,"[Magic] is set to "..lvl[tonumber(level)][1])
ticker = lvl[tonumber(level)][2]
Find(ticker)
else
SendToAll(Bot, "The level has to be between 1 and 4 ..." )
end;
end;
end;
function MagicStartb(level)
local lvl =
{
[1] = { [1] = "easy", [2] = random(3), [3] = 30000, },
[2] = { [1] = "medium", [2] = random(10), [3] = 35000, },
[3] = { [1] = "hard", [2] = random(20), [3] = 60000, },
[4] = { [1] = "unstoppable", [2] = random(60), [3] = 60000, },
}
if lvl[tonumber(level)] then
SendToAll(Bot,"[Magic] is set to "..lvl[tonumber(level)][1])
ticker = lvl[tonumber(level)][2]
SetTimer(lvl[tonumber(level)][3])
Find(ticker)
else
SendToAll(Bot, "The level has to be between 1 and 4 ..." )
end;
end;
function Find(ticker)
number = random(600)
--SendToAll(Bot,number.." x "..ticker) --debug
killer = random(4)
Translate(killer)
end
function Translate(killer)
local operation = {
[1] = { [1] = number + ticker, [2] = "Add together "..number.." and "..ticker, },
[2] = { [1] = number - ticker, [2] = "Subtract "..number.." from "..ticker, },
[3] = { [1] = number / ticker, [2] = "Divide "..number.." by "..ticker, },
[4] = { [1] = number * ticker, [2] = "Multiply "..number.." by "..ticker, },
}
answer = operation[tonumber(killer)][1]
SendToAll(Bot, operation[tonumber(killer)][2])
StartTimer()
end
function OnTimer()
StopTimer() -- stop timer be4 its too late
local insult = {
"***Failed to input correct answer",
"***No one was clever to get that answer",
"***You all are useless morons",
"***You bunch of MUPPETS!!!",
"***Useless sods",
}
local tableref = insult[random(1,getn(insult))]
SendToAll(BOT,tableref)
MagicStart(level)
end
function DataArrival(user,data)
if (strsub(data, 1, 1) == "<") then
data=strsub(data,1,strlen(data)-1)
local s,e,cmd = strfind(data,"%b<>%s+(%S+)")
local prefix = "m."
if prefix.."start" == cmd then
if not _usertbl[user.sName] then
SendToAll(Bot,"you must be first logged in")
return 1
else
local s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if nil == level then
SendToAll(Bot,"remember to select a level m.start ")
return 1
else
SendToAll(Bot,"[Magic] has been started")
MagicStart(level)
return 1;
end;
end;
elseif prefix.."stop" == cmd then
StopTimer()
SendToAll(Bot,"[Magic] has been stopped")
return 1;
elseif prefix.."login" == cmd then
if _usertbl[user.sName] then
user:SendData(Bot,"You can't log in twice :P")
return 1;
else
user:SendData(Bot,"You have succesfully logged into [Magic]")
_usertbl[user.sName] = {}
tinsert (_usertbl, 2, 0)
return 1;
end;
elseif prefix.."score" == cmd then
user:SendData(BOT,_usertbl[user.sName][2])
return 1;
elseif prefix.."version" == cmd then
SendToAll("---------=========================================================------")
SendToAll(Bot,"../// This Hub is running Phatty's [Magic] "..dVersion.." ( Herodes remix ) \\\..")
SendToAll("---------=========================================================------")
return 1
elseif prefix.."help" == cmd then
user:SendData(Bot,"---------====================================================================------")
user:SendData(Bot,"---------="..prefix.."login -------------------- Logins u in to magic =------")
user:SendData(Bot,"---------="..prefix.."start [Lvevel] ------------- Starts Magic Level 1/2/3 =------")
user:SendData(Bot,"---------="..prefix.."stop --------------------- Stops magic =------")
user:SendData(Bot,"---------="..prefix.."score -------------------- Shows Score =------")
user:SendData(Bot,"---------="..prefix.."version ------------------ Shows Script version =------")
user:SendData(Bot,"---------= a (number) --------------------------- Answer [Example a 676 ] =------")
user:SendData(Bot,"---------="..prefix.."help ----------------------- This Help =------")
user:SendData(BOT,"---------====================================================================------")
return 1;
elseif prefix.."save" == cmd then
Save()
return 1;
elseif "a" == cmd then
if _usertbl[user.sName] then
local s,e,useranswer = strfind(data,"%b<>%sa%s(%S+)")
if tonumber(useranswer) ~= answer then
SendToAll(Bot,"Incorrect")
if _usertbl[user.sName][2] < erasepoints then
user:SendPM(Bot,"You have zero score so i cant take points away from u, so i will disconnect you instead :P")
user:Disconnect()
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] - erasepoints
end;
else
SendToAll(Bot,"***"..user.sName.." scores "..ticker.." point(s)")
if nil == _usertbl[user.sName][2] or 0 == _usertbl[user.sName][2] then
_usertbl[user.sName][2] = ticker
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] + ticker
end;
SendToAll(Bot, "Now, "..user.sName.." has ".._usertbl[user.sName][2].." points")
StopTimer()
MagicStart(level)
end
else
user:SendData(Bot,"Please login first, type "..prefix.."help")
return 1;
end;
end;
end;
end;
function OnExit()
Save()
end;
function Save()
writeto("table.txt")
write("_usertbl = {\n")
for a,b in _usertbl do
write("\t[\""..a.."\"] = {"..b.."},\n")
end;
write("}")
writeto()
end;
--- [Magic]
-----------------------------------------------------------------
--- v0.71 [Magic] Written by Phatty
--- Catagory[Games]
-----------------------------------------------------------------
--- v.072 touched by Herodes 6/8 - 2004
--- Same Category .. :)
-----------------------------------------------------------------
--- v.072 fix by Shad_dow 6/8 - 2004 12:03 pm
--- Same Category .. :)
--- added help and stop functions
--- all credauts to phatty and Herodes
--- debug bit comment out :) - --SendToAll(BOT,"Answer = "..barbossa)
-----------------------------------------------------------------
--- v.073 update by Phatty 6:44am 7th Aug
--- cleaned up code ;)
--- just 1 table ;)
--- just back to lua for about an hour today :D
-----------------------------------------------------------------
--- v.074 update by Phatty 6:46am 7th Aug
--- Silly mistake fixed ;)
--- save function and command auto save in later ptokax m.save ;)
-----------------------------------------------------------------
--- v.075 update by Phatty 7:20am 7th Aug
--- dumb ass fixes
-----------------------------------------------------------------
'create file table.txt inside the text _usertbl = {}
filecheckx = openfile("table.txt", "r")
if filecheckx then
assert(dofile("table.txt"))
closefile(filecheckx)
else
_usertbl = {}
end
erasepoints = 3
Status = 2
nlevel = 1
function Main()
BOT = "[Magic]"
frmHub:RegBot(BOT)
frmHub:UnregBot(BOT)
RandStart()
dVersion = "v0.75"
end
function RandStart()
local randomstart = {
"Scripts have been rebooted",
"Warning scripts restarted",
"It's all [Magic] when scripts restart",
"Why do these scripts keep restarting",
"Will you stop restarting scripts :P",
}
local tableref = randomstart[random(1,getn(randomstart))]
SendToAll(BOT,tableref)
end
function MagicStart(level)
if (Status == 1) then
MagicStartb(level)
return 1;
else
SetTimer(1*65432)
local lvl =
{
[1] = { [1] = "easy", [2] = random(3) },
[2] = { [1] = "medium", [2] = random(10) },
[3] = { [1] = "hard", [2] = random(20) },
[4] = { [1] = "unstoppable", [2] = random(60) },
}
if lvl[tonumber(level)] then
SendToAll(BOT,"[Magic] is set to "..lvl[tonumber(level)][1])
ticker = lvl[tonumber(level)][2]
Find(ticker)
else
SendToAll(BOT, "The level has to be between 1 and 4 ..." )
end;
end;
end;
function MagicStartb(level)
local lvl =
{
[1] = { [1] = "easy", [2] = random(3), [3] = 30000, },
[2] = { [1] = "medium", [2] = random(10), [3] = 35000, },
[3] = { [1] = "hard", [2] = random(20), [3] = 60000, },
[4] = { [1] = "unstoppable", [2] = random(60), [3] = 60000, },
}
if lvl[tonumber(level)] then
SendToAll(BOT,"[Magic] is set to "..lvl[tonumber(level)][1])
ticker = lvl[tonumber(level)][2]
SetTimer(lvl[tonumber(level)][3])
Find(ticker)
else
SendToAll(BOT, "The level has to be between 1 and 4 ..." )
end;
end;
function Find(ticker)
number = random(600)
--SendToAll(BOT,number.." x "..ticker) --debug
killer = random(4)
Translate(killer)
end
function Translate(killer)
local operation = {
[1] = { [1] = number + ticker, [2] = "Add together "..number.." and "..ticker, },
[2] = { [1] = number - ticker, [2] = "Subtract "..number.." from "..ticker, },
[3] = { [1] = number / ticker, [2] = "Divide "..number.." by "..ticker, },
[4] = { [1] = number * ticker, [2] = "Multiply "..number.." by "..ticker, },
}
answer = operation[tonumber(killer)][1]
SendToAll(BOT, operation[tonumber(killer)][2])
StartTimer()
end
function OnTimer()
StopTimer() -- stop timer be4 its too late
local insult = {
"***Failed to input correct answer",
"***No one was clever to get that answer",
"***You all are useless morons",
"***You bunch of MUPPETS!!!",
"***Useless sods",
}
local tableref = insult[random(1,getn(insult))]
SendToAll(BOT,tableref)
MagicStart(level)
end
function DataArrival(user,data)
if (strsub(data, 1, 1) == "<") then
data=strsub(data,1,strlen(data)-1)
local s,e,cmd = strfind(data,"%b<>%s+(%S+)")
local prefix = "m."
if prefix.."start" == cmd then
if not _usertbl[user.sName] then
SendToAll(BOT,"you must be first logged in")
return 1
else
local s,e,cmd,level = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if nil == level then
SendToAll(BOT,"remember to select a level m.start ")
return 1
else
SendToAll(BOT,"[Magic] has been started")
nlevel = level
MagicStart(level)
return 1;
end;
end;
elseif prefix.."stop" == cmd then
StopTimer()
SendToAll(BOT,"[Magic] has been stopped")
return 1;
elseif prefix.."login" == cmd then
if _usertbl[user.sName] == 0 then
user:SendData(BOT,"You can't log in twice :P")
return 1;
else
user:SendData(BOT,"You have succesfully logged into [Magic]")
_usertbl[user.sName] = {}
tinsert (_usertbl, 2, 0)
return 1;
end;
elseif prefix.."score" == cmd then
user:SendData(BOT,_usertbl[user.sName][2])
return 1;
elseif prefix.."version" == cmd then
SendToAll("---------=========================================================------")
SendToAll(BOT,"../// This Hub is running Phatty's [Magic] "..dVersion.." ( Herodes remix ) \\\..")
SendToAll("---------=========================================================------")
return 1
elseif prefix.."help" == cmd then
user:SendData(BOT,"---------====================================================================------")
user:SendData(BOT,"---------="..prefix.."login -------------------- Logins u in to magic =------")
user:SendData(BOT,"---------="..prefix.."start [Lvevel] ------------- Starts Magic Level 1/2/3 =------")
user:SendData(BOT,"---------="..prefix.."stop --------------------- Stops magic =------")
user:SendData(BOT,"---------="..prefix.."score -------------------- Shows Score =------")
user:SendData(BOT,"---------="..prefix.."version ------------------ Shows Script version =------")
user:SendData(BOT,"---------= a (number) --------------------------- Answer [Example a 676 ] =------")
user:SendData(BOT,"---------="..prefix.."help ----------------------- This Help =------")
user:SendData(BOT,"---------====================================================================------")
return 1;
elseif prefix.."save" == cmd then
Save()
return 1;
elseif "a" == cmd then
if _usertbl[user.sName] == 0 then
local s,e,useranswer = strfind(data,"%b<>%sa%s(%S+)")
if tonumber(useranswer) ~= answer then
SendToAll(BOT,"Incorrect")
if _usertbl[user.sName][2] < erasepoints then
user:SendPM(BOT,"You have zero score so i cant take points away from u, so i will disconnect you instead :P")
user:Disconnect()
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] - erasepoints
end;
else
SendToAll(BOT,"***"..user.sName.." scores "..ticker.." point(s)")
if nil == _usertbl[user.sName][2] or 0 == _usertbl[user.sName][2] then
_usertbl[user.sName][2] = ticker
else
_usertbl[user.sName][2] = _usertbl[user.sName][2] + ticker
end;
SendToAll(BOT, "Now, "..user.sName.." has ".._usertbl[user.sName][2].." points")
StopTimer()
MagicStart(nlevel)
end
else
user:SendData(BOT,"Please login first, type "..prefix.."help")
return 1;
end;
end;
end;
end;
function OnExit()
Save()
end;
function Save()
writeto("table.txt")
write("_usertbl = {\n")
for a,b in _usertbl do
write("\t[\""..a.."\"] = {"..b.."},\n")
end;
write("}")
writeto()
end;
Hey phatty .. nice going ;)
QuoteOriginally posted by Herodes
Hey phatty .. nice going ;)
:D
lo phatty
nice to see ya still keeping magic alive :D
yours
shad