PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: b_w_johan on 04 March, 2005, 08:33:47

Title: hubinfo script ( not workin )
Post by: b_w_johan on 04 March, 2005, 08:33:47
ok i have found the script where im looking for....

copyd all parts of it i thought i could use ...

but some how it isn't working....
no errors but no reply to what it should do ...
QuotebotName = "test"
function Main()
   frmHub:RegBot(botName)
   SendToAll("   ? "..botName.." launched"..date(" the %d/%m/%Y at %X ")..". ? type !info to test")
end

function NewUserConnected(user)

end


if(cmd=="!info") then
   doInfo(user)
   return 1
end

function doInfo(user)
   user:SendData(botName,"You are in "..frmHub:GetHubName()..".|")                  -- hubname
   user:SendData(botName,"The description is "..frmHub:GetHubDescr()..".|")            -- discriptie
   user:SendData(botName,"There are "..frmHub:GetUsersCount().." users in the hub at the moment.|")   -- aantal users
   user:SendData(botName,"Redirect adress is "..frmHub:GetRedirectAddress()..".|")            -- redirectadres
   if frmHub:GetRedirectAll()==0 then
      user:SendData(botName,"New users are not redirected.|")                  -- als geen adres
   else
      user:SendData(botName,"New users are redirected to "..frmHub:GetRedirectAddress()..".|")   -- als wel adres
   end
   if frmHub:GetRedirectFull()==0 then
      user:SendData(botName,"New users are not redirected if the hub is full.|")         -- bij vol niet redirect
   else
      user:SendData(botName,"New users are redirect to "..frmHub:GetRedirectAddress()..".|")      -- bij vol wel redirect
   end
   user:SendData(botName,"Hub registed at hubs lists "..frmHub:GetRegServer()..".|")         -- registerd in hublists
   user:SendData(botName,"Max users set to "..frmHub:GetMaxUsers()..".|")               -- maxusers
   user:SendData(botName,"Max slots set to "..maxslots..".|")                  -- maxslots
end

thats what i want to see ...
minshare maxshare minslots maxslots and stuff in script above ...
but now it isn't working and i don't get why not ..
must be something stupid to miss =-p


(its from bot called "slim - en.lua" (dll from plops site =-p ))

Title:
Post by: [UK]Madman on 04 March, 2005, 11:45:45
function NewUserConnected(user)

end
 
 

Can be removed, as its not doing anything.

if(cmd=="!info") then
doInfo(user)
return 1
end

Will need to read -

function DataArrival(user,data)
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")

if cmd=="!info" then
doInfo(user)
return 1
end
Title:
Post by: NightLitch on 04 March, 2005, 12:18:08
Here this code is for the New PtokaX with Lua5

not tested but should work

botName = "test"
maxslots = 30

function Main()
frmHub:RegBot(botName)
SendToAll(" ? "..botName.." launched"..os.date(" the %d/%m/%Y at %X ")..". ? type !info to test")
end

function ChatArrival(user,data)
local _,_,cmd = string.find(data, "(%S+)%|")
if(cmd=="!info") then
doInfo(user)
return 1
end
end

function doInfo(user)
user:SendData(botName,"You are in "..frmHub:GetHubName()..".|") -- hubname
user:SendData(botName,"The description is "..frmHub:GetHubDescr()..".|") -- discriptie
user:SendData(botName,"There are "..frmHub:GetUsersCount().." users in the hub at the moment.|") -- aantal users
user:SendData(botName,"Redirect adress is "..frmHub:GetRedirectAddress()..".|") -- redirectadres
if frmHub:GetRedirectAll()==0 then
user:SendData(botName,"New users are not redirected.|") -- als geen adres
else
user:SendData(botName,"New users are redirected to "..frmHub:GetRedirectAddress()..".|") -- als wel adres
end
if frmHub:GetRedirectFull()==0 then
user:SendData(botName,"New users are not redirected if the hub is full.|") -- bij vol niet redirect
else
user:SendData(botName,"New users are redirect to "..frmHub:GetRedirectAddress()..".|") -- bij vol wel redirect
end
user:SendData(botName,"Hub registed at hubs lists "..frmHub:GetRegServer()..".|") -- registerd in hublists
user:SendData(botName,"Max users set to "..frmHub:GetMaxUsers()..".|") -- maxusers
user:SendData(botName,"Max slots set to "..maxslots..".|") -- maxslots
end

// NL
Title:
Post by: b_w_johan on 04 March, 2005, 18:04:53
Thx,

its working perfect here =-p

greetings Johan
Title:
Post by: b_w_johan on 05 March, 2005, 08:05:14
i was wondering is there a possibility to add this:

it shows names of all registerd OPs and Masters not passwords afcourse =-p

cause the network owners want to see that to ...

maybe possible with another command ..
no !info but !regs or something

Greetings Johan