PtokaX forum

PtokaX => Support => Topic started by: DorianG on 09 March, 2004, 20:04:27

Title: SendPmToOps and SendToOps for Ptokax 0.3.3.0
Post by: DorianG on 09 March, 2004, 20:04:27
If i use in my scripts to send a message SendPmToOps and SendToOps with Ptokax 0.3.3.0, the command don't works. But if instread of SendToOps i put user:SendData or an other Ptokax command, my scripts works..

Why???

Ptokax 0.3.3.0 build 15.25 [debug] doesn't have SendToOps and SendPmToOps command ??
Title:
Post by: pHaTTy on 09 March, 2004, 20:05:31
can you change it to SendPmToOps and then post the function here, see if u making a mistake....
Title:
Post by: tezlo on 09 March, 2004, 20:38:45
it works.. look for errors elsewhere
Title:
Post by: DorianG on 10 March, 2004, 09:42:48
No, i think that there aren't errors.
i think that the bot when i enter inside the hub doesn't consider me an operator, but in the users list, i have the key. Also if i use user.bOperator doesn't work. This problem there is for all operators profiles..

0|Master|10000100011111111100111000000001
1|Operator|10000100011001111100110000000001
2|VIP|10000000000001111000000000000000
3|Reg|10000000000000000000000000000000
4|Mod|10000100011111111100110000000001
5|Admin|10001100111111111100111000000001
6|Owner|10001111111111111100111000000001




Bot = "BotName"

function Main()
frmHub:RegBot(Bot)
end

function DataArrival(user, data)
if (strsub(data,1,1) == "<") then
data = strsub(data,1,strlen(data)-1)
local s,e,cmd = nil
s,e,cmd,msg = strfind( data, "%b<>%s+(%S+)s+(%S+)" )
if cmd == "!report" then
if msg ~= nil then
SendPmToOps(Bot, msg)
else
user:SendData(Bot, "post this commend in main chat !report ")
end
end
end
end
Title:
Post by: tezlo on 10 March, 2004, 13:26:31
local s, e, cmd. msg = strfind(data, "%b<>%s+(%S+)%s+(%S+)")

btw.. this will never be executed
user:SendData(Bot, "post this commend in main chat !report ")
Title:
Post by: DorianG on 10 March, 2004, 18:07:37
ok sorry i have't rewritten good the exaple.. But it is not my problem.
the problem is that if i put SendToOps enstead of user:SendData the bot not sends at the operators the message.
Title:
Post by: tezlo on 10 March, 2004, 18:33:26
so if you write..
SendToOps("someone", "something")
in a new blank script
it doesnt work?
Title:
Post by: DorianG on 11 March, 2004, 01:01:08
No if i write SendToOps in a command of my Bot or anything that it does reference to the Operator.
Example:  user.bOperator, SendPmToOps ecc.. doen't work

?????

it is strange :(
Title:
Post by: DorianG on 11 March, 2004, 01:06:12
When i have started to write my Bot these commands worked.. But when i have writen a new function that allow to set each cmds to on or off.. any commands with SendToOps ecc... doesn't works