same one can to help me with that script
and i have pxwsa.dll this file
-- Ptokax LuaScript - written by bluebear.
-- This script is a part of the pxwsa.dll packages documentation.
-- Please read the license.txt before any usage, thx.
-- ==========================================================
-- File: AsyncWhois.lua
-- Usage: +whois
-- Arg: IP/DOMAIN/HOSTNAME
-- Desc: Provides a +whois trigger to all users.
-- It only allows one user to use it at the time
-- Please note that this is a sample script.
-- I'm not a luascripter in any way.
-- You should finish this script, if you use it for
-- other things than testing.
-- You should add code for checking if the args
-- are valid so you wont crash ptokax.
-- options
rHost = "whois.ripe.net"
rPort = 43
-- Globals
running = nil
incomBuffer = ""
--Used for keeping track of user/socket/request (you should do this in tables to allow multiply users)
domain = nil
curUser = nil
curSocket = nil
-- Init lib
libinit = loadlib("../lib/pxwsa.dll", "_libinit")
libinit()
-- Init sockets
error_ = WSA.Init()
-- Resets the whois so a new users can use the trigger
function CloseSck()
errorCode, errorStr = WSA.Close(curSocket)
incomBuffer = ""
domain = nil
curUser = nil
curSocket = nil
running = nil
end
-- The next 3 functions is fired by the wsa lib when your useing async calls.
-- This function fires when a connection is established.
OnWsaConnected = function ( errorCode, errorStr, socket )
if errorCode == nil then
-- We're connected :)
SendToNick(curUser, " SocketID: "..socket.." is now connected to: "..rHost..":"..rPort)
-- Starte async receive
WSA.BeginReceive(socket)
-- Send request to whois server
WSA.BeginSend(socket, domain)
else
-- Could not connect
SendToNick(curUser, " Could not connect to: "..rHost..":"..rPort..". Error: "..errorCode.." "..errorStr)
CloseSck()
end
return 0
end
-- This function fires when a send is done. In this case it's when the whois request is sent.
OnWsaSendComplete = function ( errorCode, errorStr, socket, bytesSent )
if errorCode == nil then
SendToNick(curUser, " Sent on socket "..socket..": "..bytesSent.." bytes.")
else
-- Error dueing send
SendToNick(curUser, " Could not send request to: "..rHost..":"..rPort..". Error: "..errorCode.." "..errorStr)
CloseSck()
end
return 0
end
-- This function fires when there is data available
OnWsaDataArrival = function ( errorCode, errorStr, socket, sdata, length )
local retVal = 0 -- Return value
if errorCode == nil then
-- Receive done - but there can still be data on the socket you need to read.
-- SendToNick(curUser, "Received "..length.." bytes from socket: "..socket.." Data: "..sdata)
incomBuffer = incomBuffer..sdata
-- return > zero to tell the lib that we still wants to receive data
retVal = 1
else
-- Receive was an failure
if errorCode == 0 then
-- the connection has been gracefully closed by remotehost.
SendToNick(curUser, " n"..incomBuffer)
SendToNick(curUser, " "..errorStr)
CloseSck()
else
-- error
SendToNick(curUser, " Error: "..errorCode.." "..errorStr)
CloseSck()
end
end
return retVal
end
-- Starts the lookup
function WhoisMain( curentUser, args)
errorCode, errorStr, curSocket = WSA.NewSocket()
-- Do error handles here
curUser = curentUser
domain = args.."n"
WSA.BeginConnect(curSocket, rHost, rPort)
end
-- parse
function Get1Arg(data)
-- Written by plop
local s,e,sArg = string.find(data, "%b<>%s+%!whois%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
if running == nil then
-- arg found
running = 1
user:SendData(" looking "..sArg.." up at "..rHost)
WhoisMain(user.sName, sArg)
else
user:SendData(" Sorry, I can only serve one user at the time. Please try agian in a few seconds..")
end
return 1
else
-- no arg found
end
end
-- When ptokax stops
OnExit = function()
-- clean up.
local errorCode, errorStr = WSA.Dispose()
end
-- errortracker by uv
ErrorsTo = { -- table with nicks to get ErrorMsg
"]['rIp?iN??uN",
"YoursecondNIcknamehere",
"Etc.Etc.",
}
errBotName = "-=Sript-Error=-" -- duh..
---------------------------------- end of settings
function OnError(ErrorMsg)
for i, v in ErrorsTo do
SendPmToNick(v, errBotName, ErrorMsg)
end
end
--------------------------------------------------------------
my error [21:37] Syntax masterchat.lua:31: attempt to call global `libinit' (a nil value)
[21:42] Syntax [string "-- Ptokax LuaScript - written by bluebear.
..."]:31: attempt to call global `libinit' (a nil value)
it's my error