PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: SomeShine on 25 March, 2004, 22:23:19

Title: Request: can someone make a "simon says" script for me?
Post by: SomeShine on 25 March, 2004, 22:23:19
is it possible to make a "simon-says" script?? maybe userbound??? like f.eks writing a command like "!simon on Ferdi" and then the script copies all lines the user writes in main so its sent 2 times, and 2nd time will be from bot.. f.eks botname: "Simon-Says" ???

i hope someone can and will make one for me.. i'd like to tease my users in my hub.. LOL
Title:
Post by: kepp on 25 March, 2004, 23:32:27
Could you explain just a little more.. thanks :)
Title:
Post by: ??????Hawk?????? on 26 March, 2004, 00:01:13
he he he  nice idea  BUT  the game is all about confusing ppl in to thinking it has been said.

with it on screen do you think your gonna get any loosers..

he he he
Title: how more specific do i have to be?
Post by: SomeShine on 26 March, 2004, 00:12:07
i dont know how i can be more specific

come into my hub so we can talk about it if you need more specifications..

adress: tranceheaven.mine.nu

but as there was said, its all about confusing ppl..
Title:
Post by: kepp on 26 March, 2004, 01:13:00
ok, Pick it up :)

sBot = "Simon_Says"

tSimons = {}

function Main()
frmHub:RegBot(sBot)
end

function UserDisconnected(user)
if tSimons[user.sName]==1 then
tSimons[user.sName]=nil;
end
end

function DataArrival(user, data)
if (strsub(data,1,1)=="<") then
data = strsub(data,1,strlen(data)-1)
Process_Simons(user, data)
local s,e,cmd,name = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if (cmd=="+simon") then
vic = GetItemByName(name)
if vic ~= nil then
tSimons[vic.sName]=1;
user:SendData(sBot,vic.sName.." Was sucessfully added to be Simon Repeated.. :D") return 1
else
user:SendData(sBot,"User dosen't exist.") return 1
end

elseif (cmd=="+unsimon") then
vic = GetItemByName(name)
if vic ~= nil then
if tSimons[vic.sName]==1 then
tSimons[vic.sName]=nil;
user:SendData(sBot,vic.sName.." is not terrorised by simon anymore =(") return 1
end
else
user:SendData(sBot,"There is no such user.") return 1
end
end
end
end


function Process_Simons(user, data)

if tSimons[user.sName]==1 then
local s,e,Msg = strfind(data,"%b<>%s+(.*)")
SendToAll(sBot,Msg)
else
end
end
Title:
Post by: kepp on 26 March, 2004, 01:14:11
***UPDATE***

sBot = "Simon_Says"

tSimons = {}

function Main()
frmHub:RegBot(sBot)
end

function UserDisconnected(user)
if tSimons[user.sName]==1 then
tSimons[user.sName]=nil;
end
end

function DataArrival(user, data)
if (strsub(data,1,1)=="<") then
data = strsub(data,1,strlen(data)-1)
Process_Simons(user, data)
local s,e,cmd,name = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if (cmd=="+simon") and user.bOperator then
vic = GetItemByName(name)
if vic ~= nil then
tSimons[vic.sName]=1;
user:SendData(sBot,vic.sName.." Was sucessfully added to be Simon Repeated.. :D") return 1
else
user:SendData(sBot,"User dosen't exist.") return 1
end

elseif (cmd=="+unsimon") and user.bOperator then
vic = GetItemByName(name)
if vic ~= nil then
if tSimons[vic.sName]==1 then
tSimons[vic.sName]=nil;
user:SendData(sBot,vic.sName.." is not terrorised by simon anymore =(") return 1
end
else
user:SendData(sBot,"There is no such user.") return 1
end
end
end
end


function Process_Simons(user, data)

if tSimons[user.sName]==1 then
local s,e,Msg = strfind(data,"%b<>%s+(.*)")
SendToAll(sBot,Msg)
else
end
end