Don't know what's wrong
 

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

Don't know what's wrong

Started by dada87, 12 February, 2008, 19:32:12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dada87

I work with the All-in-One package of DixBot which include Ptokax 0.4.0.0 RC8 et DiXBoT V2.0
I try to make this script start at the user connection but hopelessly it don't, so please help.

The script:

--[[-------------------------------------------------------
  Physio Beta
  Deconnecte les utilisateurs n'ayant aucune description et qui ne sont pas a Caen
  Spray - 06/12/07
  dada87 - 12/01/08
-------------------------------------------------------]]--



 function NewUserConnected (user)
	
	if user.sMyInfoString then
		local timeanddate = os.date("%d/%m/%y %H:%M:%S") 
		local tmp = os.clock() 
		local disp = "\r\n\r\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Bienvenue sur le Hub DisneyWorld ! >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\r\n"
		local ip = string.sub(user.sIP,1,5)


		disp = disp.."<< Hub Name		: "..frmHub:GetHubName().."\r\n" 
		disp = disp.."<< Hub Address		: "..frmHub:GetHubAddress()..":"..frmHub:GetHubPort().."\r\n" 
		disp = disp.."<< Hub Date & Time	: "..timeanddate.."\r\n"

		disp = disp.."<< Your IP		: "..user.sIP.."\r\n" 

		if user.sDescription ~= nil then
			disp = disp.."<< Your description is	: "..user.sDescription.."\r\n"
		end

		if user.sEmail then 
			disp = disp.."<< Your email is		: "..user.sEmail.."\r\n"
		end

		disp = disp.."<< Your client is		: "..user.sClient.."\r\n" 

		if user.sClientVersion ~= nil then
			disp = disp.."<< Your client version is	: "..user.sClientVersion.."\r\n" 
		end


		disp = disp.."<< Your open slots are	: "..user.iSlots
		disp = disp.."\r\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\r\n"

		if user.sDescription == "" then
			disp = disp.."\r\n\r\n\r\n<< Description VIDE !!\r\n"
			disp = disp.."\r\n<< Remplissez votre description en specifiant votre PROMO et votre LOCALISATION\r\n"
			disp = disp.."<< Exemple: \"IS2 Paris\"\r\n"
		end

		if ip ~= "10.19" then
			disp = disp.."<<<<<< Mauvaise IP >>>>>>\r\n"
			disp = disp.."Vous devez etre a Caen pour pouvoir vous connecter a ce hub."
		end

		
		user:SendPM("Admins", disp)

		if user.sDescription == "" then
			user:Disconnect()
		end

		if ip ~= "10.19" then
			user:Disconnect()
		end

		disp = nil
	end
end


Maybe that came from a Bug ...???
Thanks for any answer

Snooze

#1
That script is for the old API set and wont run on any of the new PtokaX builds..

Why don't you use the build in function in DiXBoT?

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	DiXBoT][Beta-Team @ demo.dixbot.com:1212
	::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 	Your Nick                	: Snooze
 	Your IP                  	: 83.89.62.150
 	Your Client              	: Apex DC++ V:1.0.0B5
 	Your Status              	: Owner
 	Your Share               	: 0 B
 	Total Share              	: 3.87 TiB
 	Users Online             	: 11 User(s)
 	Hub Uptime               	: 3 Days, 38 Minutes, 57 Seconds
	::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	DiXBoT][Beta-Team WebSite: www.dixbot.com
	::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Gives you more or less the same info ..

/Snooze


[EDIT]

Just noticed your IP check... That is not included in DiXBoT .. Sorry..
/Snooze

Snooze

This is a 'quick 'n dirty' conversion...

--[[-------------------------------------------------------
  Physio Beta
  Deconnecte les utilisateurs n'ayant aucune description et qui ne sont pas a Caen
  Spray - 06/12/07
  dada87 - 12/01/08
-------------------------------------------------------]]--



 function UserConnected (user)
	
		local timeanddate = os.date("%d/%m/%y %H:%M:%S") 
		local tmp = os.clock() 
		local disp = "\r\n\r\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Bienvenue sur le Hub DisneyWorld ! >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\r\n"
		local ip = string.sub(user.sIP,1,5)


		disp = disp.."<< Hub Name		: "..SetMan.GetString(0).."\r\n" 
		disp = disp.."<< Hub Address		: "..SetMan.GetString(2)..":"..SetMan.GetString(3).."\r\n" 
		disp = disp.."<< Hub Date & Time	: "..timeanddate.."\r\n"

		disp = disp.."<< Your IP		: "..user.sIP.."\r\n" 

		if Core.GetUserValue(user,2) ~= nil then
			disp = disp.."<< Your description is	: "..Core.GetUserValue(user,2).."\r\n"
		end

		if Core.GetUserValue(user,5) then 
			disp = disp.."<< Your email is		: "..Core.GetUserValue(user,5).."\r\n"
		end

		disp = disp.."<< Your client is		: "..Core.GetUserValue(user,6).."\r\n" 

		if Core.GetUserValue(user,7) ~= nil then
			disp = disp.."<< Your client version is	: "..Core.GetUserValue(user,7).."\r\n" 
		end


		disp = disp.."<< Your open slots are	: "..Core.GetUserValue(user,21)
		disp = disp.."\r\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\r\n"

		if Core.GetUserValue(user,2) == "" then
			disp = disp.."\r\n\r\n\r\n<< Description VIDE !!\r\n"
			disp = disp.."\r\n<< Remplissez votre description en specifiant votre PROMO et votre LOCALISATION\r\n"
			disp = disp.."<< Exemple: \"IS2 Paris\"\r\n"
		end

		if ip ~= "10.19" then
			disp = disp.."<<<<<< Mauvaise IP >>>>>>\r\n"
			disp = disp.."Vous devez etre a Caen pour pouvoir vous connecter a ce hub."
		end

		
		Core.SendPmToNick(user.sNick,"Admins", disp)

		if user.sDescription == "" or ip ~= "10.19" then
			Core.Disconnect(user.sNick)
		end

end


/Snooze

dada87

#3
Thank you very much !
I'm going to try and I will let you know if it works.
Thx


/Edit
It works thanks

SMF spam blocked by CleanTalk