Galaxy
New Member
Hello,
For some of you this will seem very easy to do... I tried.. I even started to read the whole lua tutorial and I learned some things
But I'm not able to add exhaustion for my talkaction script...
You see, I tested this today. I launched my elfbot and I made 20 hotkeys spamming a command "!bug map,haha".
Look what I got after - yea. It took me pretty long haha xD
It means that there were over 1 milion command uses... ;P Like, I used the command 1 271 855 times - thats a lot ;p
I did it just to see what will happen haha ;D
So, here is my script...
Thank you for your help
For some of you this will seem very easy to do... I tried.. I even started to read the whole lua tutorial and I learned some things
You see, I tested this today. I launched my elfbot and I made 20 hotkeys spamming a command "!bug map,haha".
Look what I got after - yea. It took me pretty long haha xD
It means that there were over 1 milion command uses... ;P Like, I used the command 1 271 855 times - thats a lot ;p
I did it just to see what will happen haha ;D
So, here is my script...
Code:
local config =
{
access = 1
}
function onSay(cid, words, param)
if (param == '') then
doPlayerSendTextMessage(cid, 26, 'You need to say !bug map/ques/script and add description of the bug.')
return true
end
local position = getCreaturePosition(cid)
local param = string.explode(param, ',')
local params = {'map', 'quest', 'script'}
if (not param[2]) then
doPlayerSendTextMessage(cid, 26, 'Please add descripition to report.')
return true
end
if (getPlayerAccess(cid) < config.access) then
doPlayerSendTextMessage(cid, 26, 'Only support can raport bugs.')
return true
end
if (isInArray(params, param[1]) == false) then
doPlayerSendTextMessage(cid, 26, 'Wrong bug type, try again.')
return true
end
local com = tostring(param[2])
local type = tostring(param[1])
addComment(com, type, position.x, position.y, position.z)
doPlayerSendTextMessage(cid, 22, 'Bug addded to our bug list. Thanks!')
return true
end
function addComment(comments, types, posxs, posys, poszs)
db.executeQuery("INSERT INTO `bug tracker` ( `comment` , `type` , `posx` , `posy` , `posz`) VALUES ('"..comments.."', '"..types.."', "..posxs..", "..posys..", "..poszs..");")
return true
end
Thank you for your help