welcome info not working - Page 4
 

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

welcome info not working

Started by [NL]trucker, 25 February, 2004, 14:59:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kepp

See if this solves it

-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeOp = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeVip = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sOnlineOP = {}
sOnlineVIP = {}
sOnlineReg = {}
sBeforeLog = 0
sTimers = 0


function Main()
	frmHub:RegBot(sBot)
	SetTimer(1000*60*40)
	StartTimer()
end

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(user)
local t = ""
	t = t.."\r\n\r\n"
	t = t.."Welcome "..user.sName.." To "..frmHub:GetHubName().."\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Information about you :\r\n"
	t = t.."Your IP		?		"..user.sIP.."\r\n"
	t = t.."Your Client	?		"..sClient.."\r\n"
	t = t.."Version		?		"..ver.."\r\n"
	t = t.."Mode		?		"..sMode.."\r\n"
	t = t.."Your share	?		"..share.."\r\n"
	t = t.."\r\n"
	t = t.."You are in "..a.." Hubs as a normal user\r\n"
	t = t.."You are in "..b.." Hubs as a regged user\r\n"
	t = t.."You are in "..c.." Hubs as an OP user\r\n"
	t = t.."\r\n"
	t = t.."Hub Settings :\r\n"
	t = t.."Minimum share		?	"..sMinShare.."\r\n"
	t = t.."Minimum slots		?	"..sMinSlots.."\r\n"
	t = t.."Maximum slots		?	"..sMaxSlots.."\r\n"
	t = t.."Maximum hubs		?	"..sMaxHubs.."\r\n"
	t = t.."Maximum users		?	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."\r\n"
	t = t.."Hub Statistic :\r\n"
	t = t.."Uptime			?	"..sUpTime.."\r\n"
	t = t.."Amount of users now	?	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Total share amount		?	"..sCurShare.."\r\n"
	t = t.."Online OP's		?	"..getn(sOnlineOP).."\r\n"
	t = t.."Online VIP's		?	"..getn(sOnlineVIP).."\r\n"
	t = t.."Online Reg's		?	"..getn(sOnlineReg)
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	user:SendData(sBot,T)
end

function Arithmetic(user)
	local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
	share = format("%0.2f",(share / 1024 / 1024 / 1024))

	sMinShare = frmHub:GetMinShare() / 1024
	sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
	if strlen(sCurShare) <= 6 then
		sCurShare = sCurShare.." GB"
	else
		sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
	end
	return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
	if user.sMyInfoString == nil then
		user:Disconnect()
	end
	local s,e,ver = strfind(user.sMyInfoString,"V:(%S+),M:")
	local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
	if strfind(user.sMyInfoString,"<++") then
		sClient = "DC++"
	elseif strfind(user.sMyInfoString,"") then
		sClient = "Phantom DC"
	elseif strfind(user.sMyInfoString,"
Guarding    

[NL]trucker

oke here is main again:

[01:05:36]

Welcome pappa To ???? [NL] ????? ]-[?? [NL]
?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?

Information about you :
Your IP      ?      217.121.195.6
Your Client   ?      DC++
Version      ?      0.261
Mode      ?      Active
Your share   ?      56.50

You are in 0 Hubs as a normal user
You are in 14 Hubs as a regged user
You are in 17 Hubs as an OP user

Hub Settings :
Minimum share      ?   5
Minimum slots      ?   2
Maximum slots      ?   20
Maximum hubs      ?   35
Maximum users      ?   200

Hub Statistic :
Uptime         ?   0 Days 6 Hours and 44 Minutes
Amount of users now   ?   34
Total share amount      ?   965.46 GB
Online OP's      ?   1
Online VIP's      ?   0
Online Reg's      ?   0

?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?

it is looking great dont you think?


and i did set the minshare in pkotax again.
so i think that is why the minshare wasnt working.

but i allready told you i disablled all those settings in pkotax because of robocop.so my gues was you were trying to get the info from the settings in robo.

hmm typical miscommunication oh well atleast it is working sofar.
did you see the info i posted upon optimus script?


aiii i spoke to soon (:-

Syntax error: bad argument #1 to `strfind' (string expected, got nil)
stack traceback:
   1:  function `strfind' [C]
   2:  function `Client_Check' at line 121 [file `D:\==PTOTAX==\trucker\scripts\info-kepp.lua']
   3:  function `NewUserConnected' at line 165 [file `D:\==PTOTAX==\trucker\scripts\info-kepp.lua']


lol iplog :

03/04/04-01:08:35 | [NL]--Liekerdjuh | 83.117.85.10 | DC++ - 0.306
03/04/04-01:08:35 | [chello]guajiro | 62.179.20.40 | DC++ - 0.306
03/04/04-01:08:35 | TwenteEnschedeeeOleeOlee | 217.123.207.140 | DC++ - 0.306
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

kepp

i would like to invite you into my hub to take a look at my tag.

[01:20:43] <=[guard]=>

   ? User Name: pappa
   ? User Profile: Master
   ? User IP: xxx.xxx.xxx.x
   ? Client: DC++
   ? User iVersion: 0.191
   ? Descr: <++ V:0.261,M:A,H:0/13/18,S:3>
   ? Mode: Actief
   ? Conn: Cable
   ? E-Mail: None
   ? Tag Status: Ok
   ? Kicked: No kicks
   ? Warned: No warnings
   ? Away Mess: None
   ? Total Time: 0 months, 5 days, 3 hours, 16 minutes.
   ? Session Time: 12 min
   ? Share: 56.50 GB

   ? Hub(s) as Regular user: 0
   ? Hub(s) as Registerd user: 13
   ? Hub(s) as Operator: 18
   ? Open Slots: 3

   ? Upload limit: None

and tell me wich is wrong now?

script or userinfo from robo cause i dont know.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

hmm, i don't know.. is there any diference between them?

all i kinow is that betas are weird and i still believ there is a bug when you load scripts
-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeOp = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeVip = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sOnlineOP = {}
sOnlineVIP = {}
sOnlineReg = {}
sBeforeLog = 0
sTimers = 0


function Main()
	frmHub:RegBot(sBot)
	SetTimer(1000*60*40)
	StartTimer()
end

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(user)
local t = ""
	t = t.."\r\n\r\n"
	t = t.."Welcome "..user.sName.." To "..frmHub:GetHubName().."\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Information about you :\r\n"
	t = t.."Your IP		?		"..user.sIP.."\r\n"
	t = t.."Your Client	?		"..sClient.."\r\n"
	t = t.."Version		?		"..ver.."\r\n"
	t = t.."Mode		?		"..sMode.."\r\n"
	t = t.."Your share	?		"..share.."\r\n"
	t = t.."\r\n"
	t = t.."You are in "..a.." Hubs as a normal user\r\n"
	t = t.."You are in "..b.." Hubs as a regged user\r\n"
	t = t.."You are in "..c.." Hubs as an OP user\r\n"
	t = t.."\r\n"
	t = t.."Hub Settings :\r\n"
	t = t.."Minimum share		?	"..sMinShare.."\r\n"
	t = t.."Minimum slots		?	"..sMinSlots.."\r\n"
	t = t.."Maximum slots		?	"..sMaxSlots.."\r\n"
	t = t.."Maximum hubs		?	"..sMaxHubs.."\r\n"
	t = t.."Maximum users		?	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."\r\n"
	t = t.."Hub Statistic :\r\n"
	t = t.."Uptime			?	"..sUpTime.."\r\n"
	t = t.."Amount of users now	?	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Total share amount		?	"..sCurShare.."\r\n"
	t = t.."Online OP's		?	"..getn(sOnlineOP).."\r\n"
	t = t.."Online VIP's		?	"..getn(sOnlineVIP).."\r\n"
	t = t.."Online Reg's		?	"..getn(sOnlineReg)
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	user:SendData(sBot,T)
end

function Arithmetic(user)
	local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
	share = format("%0.2f",(share / 1024 / 1024 / 1024))

	sMinShare = frmHub:GetMinShare() / 1024
	sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
	if strlen(sCurShare) <= 6 then
		sCurShare = sCurShare.." GB"
	else
		sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
	end
	return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
	if user.sMyInfoString ~= nil then
		local s,e,ver,sMode = strfind(user.sMyInfoString,"V:(%S+),M:(%S),H")
		local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
		if ver == nil then
			ver = "(N/A)"
		end
		if a == nil then a = "(N/A)" end
		if b == nil then b = "(N/A)" end
		if c == nil then c = "(N/A)" end

		if sMode == "A" then sMode = "Active"
		elseif sMode == "P" then sMode = "Passive"
		else sMode = "(N/A)"
		end

		if strfind(user.sMyInfoString,"<++") then
			sClient = "DC++"
		elseif strfind(user.sMyInfoString,"") then
			sClient = "Phantom DC"
		elseif strfind(user.sMyInfoString,"
Guarding    

[NL]trucker

Kepp

are ya still with me on this one?


if so Optimus helped me with this script perhaps we can implement it.

------------------------
--test by [NL]trucker.

BotName = "-Info-"

function NewUserConnected(user)
Message(user)
end

function OpConnected(user)
Message(user)
end

--// Profile Counter
function ProfileCounter(profile)
   local table, count = GetUsersByProfile(profile), 0
   for i, User in table do
      if GetItemByName(User) then
         count = count + 1
      end
   end
   return count
end
 
function Message(user)
   local disp = ""
   doGetProfile =  GetProfileName(user.iProfile) or "Not registerd"
   disp = disp.."  \r\n===========================================================\r\n"
   disp = disp.." ?There are: "..ProfileCounter("Master").." [MASTER] online\r\n"
   disp = disp.." ?There are: "..ProfileCounter("Operator").." [OPERATOR] online\r\n"
   disp = disp.." ?There are: "..ProfileCounter("Vip").." [VIP] online\r\n"
   disp = disp.." ?There are: "..ProfileCounter("Reg").." [Registerd users] online \r\n"
   disp = disp.." \r\n"
   disp = disp.." ?There are now: "..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users Online\r\n"
   disp = disp.." ==================================================================="
   user:SendData(BotName, disp)
end



--------------------------------------------------------------

let me know what you think of it.
if you wanna see it work it is running now in my hub.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

it does the same :S
Guarding    

[NL]trucker

Kepp

you,re correct it does the same but with one diffrence

you dont have to wait for the folks to login again before it shows the correct ammount.

i started it and it showed me directly the right amount of op,s vip,s and reg,s and masters connected.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

ok, i'll take a look at it while im working at X-Ray for a bit..
I really want to understand what im doing before i go ahead and add it :)
Guarding    

[NL]trucker

okies np there kepp

just take your time

i was just trying to help make this script work..,
causse i really like it.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeOp = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeVip = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sBeforeLog = 0
sTimers = 0


function Main()
	frmHub:RegBot(sBot)
	SetTimer(1000*60*40)
	StartTimer()
end

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(user)
local t = ""
	t = t.."\r\n\r\n"
	t = t.."Welcome "..user.sName.." To "..frmHub:GetHubName().."\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Information about you :\r\n"
	t = t.."Your IP		?		"..user.sIP.."\r\n"
	t = t.."Your Client	?		"..sClient.."\r\n"
	t = t.."Version		?		"..ver.."\r\n"
	t = t.."Mode		?		"..sMode.."\r\n"
	t = t.."Your share	?		"..share.."\r\n"
	t = t.."\r\n"
	t = t.."You are in "..a.." Hub(s) as a normal user\r\n"
	t = t.."You are in "..b.." Hub(s) as a regged user\r\n"
	t = t.."You are in "..c.." Hub(s) as an OP user\r\n"
	t = t.."\r\n"
	t = t.."Hub Settings :\r\n"
	t = t.."Minimum share		?	"..sMinShare.."\r\n"
	t = t.."Minimum slots		?	"..sMinSlots.."\r\n"
	t = t.."Maximum slots		?	"..sMaxSlots.."\r\n"
	t = t.."Maximum hubs		?	"..sMaxHubs.."\r\n"
	t = t.."Maximum users		?	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."\r\n"
	t = t.."Hub Statistic :\r\n"
	t = t.."Uptime			?	"..sUpTime.."\r\n"
	t = t.."Amount of users now	?	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Total share amount		?	"..sCurShare.."\r\n"
	t = t.."Online Masters		?	"..CountProfiles("Master").."\r\n"
	t = t.."Online Ops		?	"..CountProfiles("Operator").."\r\n"
	t = t.."Online VIPs		?	"..CountProfiles("Vip").."\r\n"
	t = t.."Online Regs             	?	"..CountProfiles("Reg")
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	user:SendData(sBot,T)
end

function CountProfiles(profile)
local t,c = GetUsersByProfile(profile),0
	for i,user in t do
		if GetItemByName(user) then
		c = c + 1
		end
	end
	return c
end

function Arithmetic(user)
	local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
	share = format("%0.2f",(share / 1024 / 1024 / 1024))

	sMinShare = frmHub:GetMinShare() / 1024
	sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
	if strlen(sCurShare) <= 6 then
		sCurShare = sCurShare.." GB"
	else
		sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
	end
	return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
	if user.sMyInfoString ~= nil then
		local s,e,ver,sMode = strfind(user.sMyInfoString,"V:(%S+),M:(%S),H")
		local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
		if ver == nil then
			ver = "(N/A)"
		end

		if a == nil then a = "(N/A)" end
		if b == nil then b = "(N/A)" end
		if c == nil then c = "(N/A)" end

		if sMode == "A" then sMode = "Active"
		elseif sMode == "P" then sMode = "Passive"
		else sMode = "(N/A)"
		end

		if strfind(user.sMyInfoString,"<++") then
			sClient = "DC++"
		elseif strfind(user.sMyInfoString,"") then
			sClient = "Phantom DC"
		elseif strfind(user.sMyInfoString,"

ihope this is OK?
i don't know about the iplog yet... seems to work better.. :)
Guarding    

Tarot

i have test it it work oke
it is a great Welcome message
Gothic Metal City
       

photoshop and 3D



[NL]trucker

Kepp

it is working fine just one little thing isnt right yet.

Welcome pappa To ???? [NL] ????? ]-[?? [NL]
?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?

Information about you :
Your IP      ?      xxx.xxx.xxx
Your Client   ?      DC++
Version      ?      0.261
Mode      ?      Active
Your share   ?      56.50

You are in 0 Hub(s) as a normal user
You are in 15 Hub(s) as a regged user
You are in 16 Hub(s) as an OP user

------------------------------------------------------

info on user
--------------
[11:22:08] <=[guard]=>

   ? User Name: pappa
   ? User Profile: Master
   ? User IP: xxx.xxx.xxx.xxx.
   ? Client: DC++
   ? User iVersion: 0.191
   ? Descr: <++ V:0.261,M:A,H:0/14/17,S:3>
   ? Mode: Actief
   ? Conn: Cable
   ? E-Mail: trucker01@home.nl
   ? Tag Status: Ok
   ? Kicked: No kicks
   ? Warned: No warnings
   ? Away Mess: None
   ? Total Time: 0 months, 7 days, 11 hours, 53 minutes.
   ? Session Time: 4 min
   ? Share: 56.50 GB

   ? Hub(s) as Regular user: 0
   ? Hub(s) as Registerd user: 14
   ? Hub(s) as Operator: 17
   ? Open Slots: 3

-----------------------------------------------------------------

hubcount is not correct yet.

online OP,s and Vips en reg users is working fine now :-))

wel done and thnx
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

hubcount is not que?
:S

What's wrong with it? ;)
Guarding    

[NL]trucker

kepp

sorry m8 look at this: this comes from info from robocop.

 Hub(s) as Regular user: 0
? Hub(s) as Registerd user: 14
? Hub(s) as Operator: 17
? Open Slots: 3

and now look at the info from the bot:

Information about you :
Your IP ? xxx.xxx.xxx
Your Client ? DC++
Version ? 0.261
Mode ? Active
Your share ? 56.50

You are in 0 Hub(s) as a normal user
You are in 15 Hub(s) as a regged user
You are in 16 Hub(s) as an OP user


there is a difrence between where i am regged and where i am an OP between those two.


that was what i ment with wong hubcount.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

Ok... i can't fix that!
because there is nothing wrong with it..
Guarding    

kepp

#90
local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")

a is the first number(s) after H: in your decscription tag,
then b is H:Number/number2           and c is     /number3

so, that is, for instance H:0/1/1

and as you can see

You are in "..a.." Hub(s) as a normal user\r\n
You are in "..b.." Hub(s) as a normal user\r\n
You are in "..c.." Hub(s) as a normal user\r\n

That will print the numbers from your tag.

0 1 1
Guarding    

[NL]trucker

kepp

the problem is most likley that in your own hub you are counted as a regged user that is why there is a diffrence between client and bot.

i got this knowledge from someone alse :-))
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

Kepp

no other errors sofar script is working fine now thanks alot for your time and effort.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

Np, tell me if you wish anything else :P
Guarding    

[NL]trucker

kepp

i get this error after a nght testdrive (:-

Syntax error: attempt to perform arithmetic on local `share' (a nil value)
stack traceback:
   1:  function `Arithmetic' at line 117 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   2:  function `Send_Info' at line 68 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   3:  function `NewUserConnected' at line 190 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']

i added 4 lines to the scrpt in the welcome part there just names of ops and vips
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

ok, since it was ok for a long time i can only think of this

-- Bot Name
sBot = "OoOoOo"

-- Changeable Settings

sNetwork = "Network name"
sWebSite = "http://www.ourhub.com"
-- Files
fLogg = "OoOoOo/iplog.txt"
fClones = "OoOoOo/clones.txt"

sMinSlots = 1
sMaxSlots = 10
sMaxHubs = 8

-- Block clones, 0 = Disabled
sBlockClones = 0
-- if this is disabled the timmer will trigger at 40 minuts, else 80
sTriggerEight = 1

-- 1 = Yes/0 = no, Send Welcome message
sHubOwner = 1
sMaster = 1
sOp = 1
sVip = 1

--Messages
sUsrmsg = "Welcome [USER], Your IP is [IP]"

tWelcomeHubOwner = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeMaster = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeOp = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

tWelcomeVip = {
	["kepp"]="Welcome message here.",
	["kepp2"]="Welcome msg here."}

-- Don't chnage anything below this point
tLogIp = {}
tClone = {}
sBeforeLog = 0
sTimers = 0


function Main()
	frmHub:RegBot(sBot)
	SetTimer(1000*60*40)
	StartTimer()
end

function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(user)
local t = ""
	t = t.."\r\n\r\n"
	t = t.."Welcome "..user.sName.." To "..frmHub:GetHubName().."\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
	t = t.."Information about you :\r\n"
	t = t.."Your IP		?		"..user.sIP.."\r\n"
	t = t.."Your Client	?		"..sClient.."\r\n"
	t = t.."Version		?		"..ver.."\r\n"
	t = t.."Mode		?		"..sMode.."\r\n"
	t = t.."Your share	?		"..share.."\r\n"
	t = t.."\r\n"
	t = t.."You are in "..a.." Hub(s) as a normal user\r\n"
	t = t.."You are in "..b.." Hub(s) as a regged user\r\n"
	t = t.."You are in "..c.." Hub(s) as an OP user\r\n"
	t = t.."\r\n"
	t = t.."Hub Settings :\r\n"
	t = t.."Minimum share		?	"..sMinShare.."\r\n"
	t = t.."Minimum slots		?	"..sMinSlots.."\r\n"
	t = t.."Maximum slots		?	"..sMaxSlots.."\r\n"
	t = t.."Maximum hubs		?	"..sMaxHubs.."\r\n"
	t = t.."Maximum users		?	"..frmHub:GetMaxUsers().."\r\n"
	t = t.."\r\n"
	t = t.."Hub Statistic :\r\n"
	t = t.."Uptime			?	"..sUpTime.."\r\n"
	t = t.."Amount of users now	?	"..frmHub:GetUsersCount().."\r\n"
	t = t.."Total share amount		?	"..sCurShare.."\r\n"
	t = t.."Online Masters		?	"..CountProfiles("Master").."\r\n"
	t = t.."Online Ops		?	"..CountProfiles("Operator").."\r\n"
	t = t.."Online VIPs		?	"..CountProfiles("Vip").."\r\n"
	t = t.."Online Regs             	?	"..CountProfiles("Reg")
	t = t.."\r\n\r\n"
	t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
	T = t
	user:SendData(sBot,T)
end

function CountProfiles(profile)
local t,c = GetUsersByProfile(profile),0
	for i,user in t do
		if GetItemByName(user) then
		c = c + 1
		end
	end
	return c
end

function Arithmetic(user)
	local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
	share = tonumber(share)
	share = format("%0.2f",(share / 1024 / 1024 / 1024))

	sMinShare = frmHub:GetMinShare() / 1024
	sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
	if strlen(sCurShare) <= 6 then
		sCurShare = sCurShare.." GB"
	else
		sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
	end
	return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
	if user.sMyInfoString ~= nil then
		local s,e,ver,sMode = strfind(user.sMyInfoString,"V:(%S+),M:(%S),H")
		local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
		if ver == nil then
			ver = "(N/A)"
		end

		if a == nil then a = "(N/A)" end
		if b == nil then b = "(N/A)" end
		if c == nil then c = "(N/A)" end

		if sMode == "A" then sMode = "Active"
		elseif sMode == "P" then sMode = "Passive"
		else sMode = "(N/A)"
		end

		if strfind(user.sMyInfoString,"<++") then
			sClient = "DC++"
		elseif strfind(user.sMyInfoString,"") then
			sClient = "Phantom DC"
		elseif strfind(user.sMyInfoString,"
Guarding    

[NL]trucker

Kepp

thnx

can you tell me what you have changed?
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

share = tonumber(share)
Guarding    

[NL]trucker

Kepp

i get this error

Syntax error: attempt to perform arithmetic on local `share' (a nil value)
stack traceback:
   1:  function `Arithmetic' at line 118 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   2:  function `Send_Info' at line 68 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   3:  function `NewUserConnected' at line 191 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']

so dont know what is wrong with it
could you please help?

first line = 65
last line = 197
-----------------------------------------------------------------


function Send_Info(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
sUpTime = SynHubTime()
share,sMinShare,sCurShare = Arithmetic(user)
local t = ""
   t = t.."\r\n\r\n"
   t = t.."Welcome "..user.sName.." To "..frmHub:GetHubName().."\r\n"
   t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?\r\n\r\n"
   t = t.."Information about you :\r\n"
   t = t.."Your IP      ?      "..user.sIP.."\r\n"
   t = t.."Your Client   ?      "..sClient.."\r\n"
   t = t.."Version      ?      "..ver.."\r\n"
   t = t.."Mode      ?      "..sMode.."\r\n"
   t = t.."Your share   ?      "..share.."\r\n"
   t = t.."\r\n"
   t = t.."You are in "..a.." Hub(s) as a normal user\r\n"
   t = t.."You are in "..b.." Hub(s) as a regged user\r\n"
   t = t.."You are in "..c.." Hub(s) as an OP user\r\n"
   t = t.."\r\n"
   t = t.."Hub Settings :\r\n"
   t = t.."Minimum share      ?   "..sMinShare.."\r\n"
   t = t.."Minimum slots      ?   "..sMinSlots.."\r\n"
   t = t.."Maximum slots      ?   "..sMaxSlots.."\r\n"
   t = t.."Maximum hubs      ?   "..sMaxHubs.."\r\n"
   t = t.."Maximum users      ?   "..frmHub:GetMaxUsers().."\r\n"
   t = t.."\r\n"
   t = t.."Hub Statistic :\r\n"
   t = t.."Uptime         ?   "..sUpTime.."\r\n"
   t = t.."Amount of users now   ?   "..frmHub:GetUsersCount().."\r\n"
   t = t.."Total share amount      ?   "..sCurShare.."\r\n"
   t = t.."Online Masters      ?   "..CountProfiles("Master").."\r\n"
   t = t.."Online Ops      ?   "..CountProfiles("Operator").."\r\n"
   t = t.."Online VIPs      ?   "..CountProfiles("Vip").."\r\n"
   t = t.."Online Regs                ?   "..CountProfiles("Reg")
   t = t.."\r\n\r\n"
   t = t.."?-=-=-=-=-=-=-=-=-? I N F O R M A T I O N ?-=-=-=-=-=-=-=-=-?"
   T = t
   user:SendData(sBot,T)
end

function CountProfiles(profile)
local t,c = GetUsersByProfile(profile),0
   for i,user in t do
      if GetItemByName(user) then
      c = c + 1
      end
   end
   return c
end

function Arithmetic(user)
   local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
   share = tonumber(share)
   share = format("%0.2f",(share / 1024 / 1024 / 1024))

   sMinShare = frmHub:GetMinShare() / 1024
   sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
   if strlen(sCurShare) <= 6 then
      sCurShare = sCurShare.." GB"
   else
      sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
   end
   return share,sMinShare,sCurShare
end

function Client_Check(user)
--Ver,Client
   if user.sMyInfoString ~= nil then
      local s,e,ver,sMode = strfind(user.sMyInfoString,"V:(%S+),M:(%S),H")
      local s,e,a,b,c = strfind(user.sMyInfoString,"H:(%d+)/(%d+)/(%d+)")
      if ver == nil then
         ver = "(N/A)"
      end

      if a == nil then a = "(N/A)" end
      if b == nil then b = "(N/A)" end
      if c == nil then c = "(N/A)" end

      if sMode == "A" then sMode = "Active"
      elseif sMode == "P" then sMode = "Passive"
      else sMode = "(N/A)"
      end

      if strfind(user.sMyInfoString,"<++") then
         sClient = "DC++"
      elseif strfind(user.sMyInfoString,"         sClient = "Opera DC"
      elseif strfind(user.sMyInfoString,"         sClient = "Opera DC"
      elseif strfind(user.sMyInfoString,"         sClient = "DC-GUI"
      elseif strfind(user.sMyInfoString,"http://dc.ketelhot.de") then
         sClient = "DC-GUI"
      elseif strfind(user.sMyInfoString,"         sClient = "DC:PRO"
      elseif strfind(user.sMyInfoString,"<.P>") then
         sClient = "Phantom DC"
      elseif strfind(user.sMyInfoString,"         sClient = "NeoModus Direct Connect"
      else
         sClient = "(N/A)"
      end
      return a,b,c,sMode,ver,sClient
   end
end

function SynHubTime()
SC = clock()
sUpTime = floor(SC/86400).." Days "..floor(mod(SC/3600,24)).." Hours and "..floor(mod(SC/60,60)).." Minutes"
   return sUpTime
end

function NewUserConnected(user)
a,b,c,sMode,ver,sClient = Client_Check(user)
if tLogIp[user.sName] == nil then
   tLogIp[user.sName] = user.sIP
end
if sBlockClones==1 then
   if tClone[user.sIP] then
      user:SendData(sBot,"You are a clone of "..user.sIP..".")
      Write_Clone(user)
      user:Disconnect()
   else
      tClone[user.sIP] = user.sName
   end
end
Send_Info(user)
   if user.iProfile == 2 and sVip == 1 and tWelcomeVip[user.sName] then
      SendToAll(sBot,tWelcomeVip[user.sName])
   elseif user.iProfile == -1 then
      sUsrmsg = gsub(sUsrmsg,"%b[USER]",user.sName)
      sUsrmsg = gsub(sUsrmsg,"%b[IP]",user.sIP)
      user:SendData(sBot,sUsrmsg)
------------------------------------------------------------------------
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


Skrollster

#99
change:

function Arithmetic(user)
	local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
	share = tonumber(share)
	share = format("%0.2f",(share / 1024 / 1024 / 1024))

	sMinShare = frmHub:GetMinShare() / 1024
	sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
	if strlen(sCurShare) <= 6 then
		sCurShare = sCurShare.." GB"
	else
		sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
	end
	return share,sMinShare,sCurShare
end

to

function Arithmetic(user)
	local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+)%$")
	share = tonumber(share)
	if not share then
		error("Couldn't get the user: "..user.sName.."'s share, myinfo string is: "..user.sMyInfoString)
	end
	share = format("%0.2f",(share / 1024 / 1024 / 1024))

	sMinShare = frmHub:GetMinShare() / 1024
	sCurShare = format("%0.2f",(frmHub:GetCurrentShareAmount() / 1024 / 1024 / 1024))
	if strlen(sCurShare) <= 6 then
		sCurShare = sCurShare.." GB"
	else
		sCurShare = format("%0.2f",(sCurShare / 1024)).." TB"
	end
	return share,sMinShare,sCurShare
end

now you will know why it gets like this, and then you can post the error message here and someone will know what to do..

SMF spam blocked by CleanTalk