How ??
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

How ??

Started by No0bie, 18 October, 2003, 20:15:05

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

No0bie

How can I make this send the information to users in a PM??

sBotName = "Information"

frmHub:RegBot(sBotName)

 

function CountMASTERs() 
local tmp, online = GetUsersByProfile(GetProfileName(0)), {n=0} 
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end 
end return online.n 
end

function CountOPs() 
local tmp, online = GetUsersByProfile(GetProfileName(1)), {n=0} 
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end 
end return online.n 
end 


function CountVIPs() 
local tmp, online = GetUsersByProfile(GetProfileName(2)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end 
end return online.n 
end 

function CountRegs() 
local tmp, online = GetUsersByProfile(GetProfileName(3)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end 
end return online.n 
end

function OpConnected(user) 
local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$") 
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024)) 

local tmp 
tmp = "Welcome to "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n" 
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n" 
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\t??? Hub Address: retreat.redirectme.net\r\n" 
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Users Online: "..frmHub:GetUsersCount().."\r\n" 
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..CountMASTERs().."\r\n" 
tmp = tmp.."\t??? Operators Online: "..CountOPs().."\r\n" 
tmp = tmp.."\t??? VIPs Online: "..CountVIPs().."\r\n"
tmp = tmp.."\t??? REGs Online: "..CountRegs().."\r\n"
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? To see the NEWEST additions, type  !tag \r\n" 
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules.  Read them!! \r\n" 
tmp = tmp.."\t??? Be sure to READ EVERYTHING in the Main chat window!! \r\n"
tmp = tmp.."\t??? If you like this hub, don't forget to add it to your favorites by typing /fav in mainchat \r\n" 
 
user:SendData(sBotName,tmp) 
end 


--function NewUserConnected(user) 
--	local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$") 
--	usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))

function NewUserConnected(user) 
i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)$") 
-- this if routine is checking so if the share cannot be extracted , shre equals to zero. and 
-- prevents nil / 1024 * 1024 * 1024 (which are causing the error) 
if share == nil then 
share = 0 
end 
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))   

local tmp 
tmp = "Welcome to "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n" 
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n" 
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\t??? Hub Address: retreat.redirectme.net\r\n" 
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Users Online: "..frmHub:GetUsersCount().."\r\n" 
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..CountMASTERs().."\r\n" 
tmp = tmp.."\t??? Operators Online: "..CountOPs().."\r\n" 
tmp = tmp.."\t??? VIPs Online: "..CountVIPs().."\r\n"
tmp = tmp.."\t??? REGs Online: "..CountRegs().."\r\n"
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? To see the NEWEST additions, type  !tag \r\n" 
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules.  Read them!! \r\n" 
tmp = tmp.."\t??? Be sure to READ EVERYTHING in the Main chat window!! \r\n"
tmp = tmp.."\t??? If you like this hub, don't forget to add it to your favorites by typing /fav in mainchat \r\n" 
 
user:SendData(sBotName,tmp) 
end


Thank you in advance!!

pHaTTy

like this


sBotName = "Information"

frmHub:RegBot(sBotName)

 

function CountMASTERs() 
local tmp, online = GetUsersByProfile(GetProfileName(0)), {n=0} 
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end 
end return online.n 
end

function CountOPs() 
local tmp, online = GetUsersByProfile(GetProfileName(1)), {n=0} 
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end 
end return online.n 
end 


function CountVIPs() 
local tmp, online = GetUsersByProfile(GetProfileName(2)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end 
end return online.n 
end 

function CountRegs() 
local tmp, online = GetUsersByProfile(GetProfileName(3)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end 
end return online.n 
end

function OpConnected(user) 
local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$") 
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024)) 

local tmp 
tmp = "Welcome to "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n" 
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n" 
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\t??? Hub Address: retreat.redirectme.net\r\n" 
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Users Online: "..frmHub:GetUsersCount().."\r\n" 
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..CountMASTERs().."\r\n" 
tmp = tmp.."\t??? Operators Online: "..CountOPs().."\r\n" 
tmp = tmp.."\t??? VIPs Online: "..CountVIPs().."\r\n"
tmp = tmp.."\t??? REGs Online: "..CountRegs().."\r\n"
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? To see the NEWEST additions, type  !tag \r\n" 
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules.  Read them!! \r\n" 
tmp = tmp.."\t??? Be sure to READ EVERYTHING in the Main chat window!! \r\n"
tmp = tmp.."\t??? If you like this hub, don't forget to add it to your favorites by typing /fav in mainchat \r\n" 
 
user:SendPM(sBotName,tmp) 
end 


--function NewUserConnected(user) 
--	local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$") 
--	usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))

function NewUserConnected(user) 
i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)$") 
-- this if routine is checking so if the share cannot be extracted , shre equals to zero. and 
-- prevents nil / 1024 * 1024 * 1024 (which are causing the error) 
if share == nil then 
share = 0 
end 
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))   

local tmp 
tmp = "Welcome to "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n" 
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n" 
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n" 
tmp = tmp.."\t??? Hub Address: retreat.redirectme.net\r\n" 
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n" 
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? Users Online: "..frmHub:GetUsersCount().."\r\n" 
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..CountMASTERs().."\r\n" 
tmp = tmp.."\t??? Operators Online: "..CountOPs().."\r\n" 
tmp = tmp.."\t??? VIPs Online: "..CountVIPs().."\r\n"
tmp = tmp.."\t??? REGs Online: "..CountRegs().."\r\n"
tmp = tmp.."\ \r\n" 
tmp = tmp.."\t??? To see the NEWEST additions, type  !tag \r\n" 
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules.  Read them!! \r\n" 
tmp = tmp.."\t??? Be sure to READ EVERYTHING in the Main chat window!! \r\n"
tmp = tmp.."\t??? If you like this hub, don't forget to add it to your favorites by typing /fav in mainchat \r\n" 
 
user:SendPM(sBotName,tmp) 
end


l8rr,,

-phatty
Resistance is futile!

No0bie

user:SendPM(sBotName,tmp)

I feel like an idiot but trying to learn..

pHaTTy

dont worry about it, when i was first learning i hadnt the slightest idea ;)


-phatty
Resistance is futile!

SMF spam blocked by CleanTalk