welcome info not working - Page 5
 

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.

[NL]trucker

thnks skrollster

if i get any error i will post it here.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

skrollster

i think your solution worked.

here is the error i get

yntax error: Couldn't get the user: Whipper's share, myinfo string is: $MyINFO $ALL Whipper $ $LAN(T3)$$174568945745.92$|
stack traceback:
   1:  function `error' [C]
   2:  function `Arithmetic' at line 119 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   3:  function `Send_Info' at line 68 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   4:  function `NewUserConnected' at line 195 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']

Syntax error: Couldn't get the user: Whipper's share, myinfo string is: $MyINFO $ALL Whipper $ $LAN(T3)$$174568945745.92$|
stack traceback:
   1:  function `error' [C]
   2:  function `Arithmetic' at line 119 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   3:  function `Send_Info' at line 68 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']
   4:  function `NewUserConnected' at line 195 [file `...\==PTOTAX==\trucker\scripts\welkominfo-kepp.lua']


as far as i can see this user has a rotten Myinfo

is there something we can do about this?
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


Skrollster

there is 2 ways as i see it, either we let the users have a decimal share, this isn't possible in reality:

function Arithmetic(user)
	local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+%.?%d*)%$")-- this should capure shares with a dot in the number...
	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

or we can consider the share to be 0, though the user probably fakes any how...

function Arithmetic(user)
	local s,e,share = strfind(user.sMyInfoString,"%$%s*(%d+%.?%d*)%$")-- this should capure shares with a dot in the number...
	share = tonumber(share)
	if not share then
		share = 0
	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

[NL]trucker

thnx skrollster

i,m gonna give the last option a try as this isnt a sharecheck bot but a welcominfo bot.

will let you know if this works.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


kepp

Thanks Skrollster!!

I've never seen a InfoString like that :S

Later
Guarding    

SMF spam blocked by CleanTalk