Author Topic: pls help meee  (Read 2647 times)

0 Members and 1 Guest are viewing this topic.

Offline satya

  • Fulll Member
  • ****
  • Posts: 64
  • Karma: +3/-5
pls help meee
« on: 27 April, 2008, 12:36:20 »
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
Code: [Select]
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

Code: [Select]
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

Eyes says everything,
Its on you how u read em...

PtokaX forum

pls help meee
« on: 27 April, 2008, 12:36:20 »

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 478
  • Karma: +209/-22
  • PtokaX developer
Re: pls help meee
« Reply #1 on: 27 April, 2008, 12:42:08 »
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..
Code: [Select]
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
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: pls help meee
« Reply #2 on: 27 April, 2008, 13:09:27 »
This is a heads-up that the wiki badly needs updating. :-/
Everything could have been anything else and it would have just as much meaning.

Offline satya

  • Fulll Member
  • ****
  • Posts: 64
  • Karma: +3/-5
Re: pls help meee
« Reply #3 on: 28 April, 2008, 09:00:19 »

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

Eyes says everything,
Its on you how u read em...

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: pls help meee
« Reply #4 on: 28 April, 2008, 19:54:17 »
For trying the scripts, you can run the Lua executable. The scripting documentation and the Lua manual can help you. You don't have to start with PtokaX, I recommend generic Lua first.
Everything could have been anything else and it would have just as much meaning.

PtokaX forum

Re: pls help meee
« Reply #4 on: 28 April, 2008, 19:54:17 »