PtokaX forum

Development Section => LUA & PtokaX-Scripting-Interface => Topic started by: bluebear on 12 August, 2005, 22:17:11

Title: Lua Extension: Sockets for PtokaX 0.3.3.21
Post by: bluebear on 12 August, 2005, 22:17:11
Socket lib available for ptokax.

Use sockets in your px lua scripts.

Read more here:
http://www.thewildplace.dk/lua/wsa/

/Bluebear
Title:
Post by: Psycho_Chihuahua on 12 August, 2005, 22:27:49
nice work bluebear

i put the file on my Ptx Mirror  (http://ptokax.psycho-chihuahua.net/?dir=Scripts/Lua%205%20Scripts/)  as well :)
Title:
Post by: bastya_elvtars on 12 August, 2005, 22:30:30
Can you add an option to send TCP-packets with pre-specified flags (like imitating a handshake by sending a SYN flag?)

-- // EDIT

Please consider uploading it to the script database... ;)
Title:
Post by: Optimus on 13 August, 2005, 12:20:11
Cool stuff bluebear looks really good.

- Opti :D
Title:
Post by: bluebear on 13 August, 2005, 14:03:43
Thx for the replys :)

btw i created a forum on http://www.thewildplace.dk/ if there is any questions..

To those of you there will use it: Don't expect that i will follow other threads on this board, besides the ones i created myself.

Please use the forum, instead of pm'ing me on hubs where i'm online if you got any support/bug/request questions. Ofcourse your welcome to pm me if you just want a chat :)

If you create scripts that use this lib, I would be happy if you'd share/post it in the forum on my page.
Title:
Post by: bastya_elvtars on 15 August, 2005, 22:35:41
Can you implement a feature that gets the state of a socket?
Title:
Post by: bluebear on 16 August, 2005, 22:03:37
QuoteOriginally posted by bastya_elvtars
Can you implement a feature that gets the state of a socket?

I could, but the intension is that use a global for it.
For multiply sockets you could use a table.
Title:
Post by: plop on 18 August, 2005, 18:18:58
QuoteOriginally posted by bluebear
QuoteOriginally posted by bastya_elvtars
Can you implement a feature that gets the state of a socket?

I could, but the intension is that use a global for it.
For multiply sockets you could use a table.

sounds like a feature for WsaSocket.lua.

for the peeps who don't know yet.
WsaSocket.lua is a support script for bluebear's library which handles all basic features.
far from done, but here's a example script which shows how easy it works.
function Get1Arg(data)
-- Written by plop
local s,e,sArg = string.find(data, "%b<>%s+%pwhois%s+(%S+)")
if sArg then
return sArg
end
end

-- Ptokax chat arrival
function ChatArrival(user, data)
-- written by plop
local data = string.sub(data, 1, (string.len(data) - 1))
local sArg = Get1Arg(data)
if sArg then
local Sock = require("libs/WsaSocket")
local _Error, sData = Sock.WhoIs(sArg)
user:SendData("WhoisBOT", (_Error or sData))
return 1
end
end

plop
Title:
Post by: bastya_elvtars on 20 August, 2005, 23:54:31
Dedicated wiki page for the manual is up. Read, edit and enjoy! N. B.: the manual is for the upcoming version.