hey guyss help me out b4 i scratch all my hairs off :-X
i wanted to learn lua to script in ptokax, i just got a site from this very forum so here is the site wich i m usin for the same
http://wiki.ptokax.ath.cx/doku.php?id=scriptinghelp:ptokaxapi#the_frmhub_object
from this site i have used the xample codes in my hub just take a look at them
function NewUserConnected(user)
user:SendData("Welcome-Bot","Welcome! Have a good time!")
end
function ChatArrival(user,data)
data=string.sub(data,1,string.len(data)-1) -- remove end pipe
if string.find(data,"https?://") or string.find(data,"www%.") then -- if this string is found then
user:SendData("AntiAdvBot","Do not post URLs!") -- send a message
user:Disconnect() -- and disconnect
return 1 -- block the chat message
end
end
well this are 2 diff codes wich i have used for 2 diff scripts and nothin is happenin mannn i m usin ptokax 0.4.0.0 the latest one no error nothing but i don get output mannn can ne one tell me y
You using examples that are for old PtokaX versions and not working on 0.4.0.0. Check scripting.docs folder that is in package with PtokaX.
For 0.4.0.0 that code will looks like..
function UserConnected(user)
Core.SendToUser(user, "<Welcome-Bot> Welcome! Have a good time!")
end
function ChatArrival(user, data)
data=string.sub(data,1,string.len(data)-1) -- remove end pipe
if string.find(data,"https?://") or string.find(data,"www%.") then -- if this string is found then
Core.SendToUser(user, "<AntiAdvBot> Do not post URLs!") -- send a message
Core.Disconnect(user) -- and disconnect
return true -- block the chat message
end
end
This is a heads-up that the wiki badly needs updating. :-/
well thanks for dat but i copied the script wich u said dat is for the ptokax 0.4.0.0 but still its not working mann
well can u tell me a site or nething wich can help me to learn the scripting. and also is there ne software just like the C compiler where we write the codes n execute it, for tryin this scriptsss
For trying the scripts, you can run the Lua executable (http://luabinaries.luaforge.net/). The scripting documentation and the Lua manual can help you. You don't have to start with PtokaX, I recommend generic Lua first.