[Magic] By Phatty
 

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

[Magic] By Phatty

Started by pHaTTy, 28 December, 2003, 03:25:29

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pHaTTy

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 ;)
Resistance is futile!

pHaTTy

btw you will see that the aim of this bot is to be very random, soon everything will be just about random lol ;)
Resistance is futile!

Intel

before i can give my comments, may i know what the purpose of this script ? said it other words...what does this script do ?
Punnakku

pHaTTy

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
Resistance is futile!

pHaTTy

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
Resistance is futile!

pHaTTy

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
Resistance is futile!

pHaTTy

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
Resistance is futile!

pHaTTy

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
Resistance is futile!

spurlos

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?

pHaTTy

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,, ;)
Resistance is futile!

H?LL?L?L??nG?L

#10
: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

pHaTTy

whoa i forgot about this lol, i forgot to release a working version, i guess im gonna have to finish it sometime ;-)
Resistance is futile!

H?LL?L?L??nG?L

:P Nice decision.... i hope *sometime* is Reeeeaally soon  :P  :P  :P id luv to see this working :]

pHaTTy

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
Resistance is futile!

H?LL?L?L??nG?L

#14
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:  

Cp6uja

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

pHaTTy

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
Resistance is futile!

pHaTTy

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
Resistance is futile!

H?LL?L?L??nG?L

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

H?LL?L?L??nG?L

;) 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

Herodes

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 .. :)

((UKSN))shad_dow

Nice 1 Herodes

and if phatty bans ya il give him a slap , mmm 2nd thorughts he might like that LMAO

yours shad :D
creator of Therapy-X? bot

H?LL?L?L??nG?L

#22
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 :)

((UKSN))shad_dow

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
creator of Therapy-X? bot

H?LL?L?L??nG?L

:]  :]  :] 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 ;)

SMF spam blocked by CleanTalk