Author Topic: Don't know what's wrong  (Read 3313 times)

0 Members and 1 Guest are viewing this topic.

Offline dada87

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Don't know what's wrong
« on: 12 February, 2008, 19:32:12 »
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:

Code: [Select]
--[[-------------------------------------------------------
  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
« Last Edit: 12 February, 2008, 19:34:03 by dada87 »

PtokaX forum

Don't know what's wrong
« on: 12 February, 2008, 19:32:12 »

Offline Snooze

  • Scripter
  • Viking
  • ******
  • Posts: 606
  • Karma: +54/-3
    • DiXBoT Website
Re: Don't know what's wrong
« Reply #1 on: 12 February, 2008, 20:51:08 »
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?

Code: [Select]
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
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
« Last Edit: 12 February, 2008, 20:55:39 by Snooze »

Offline Snooze

  • Scripter
  • Viking
  • ******
  • Posts: 606
  • Karma: +54/-3
    • DiXBoT Website
Re: Don't know what's wrong
« Reply #2 on: 12 February, 2008, 21:23:32 »
This is a 'quick 'n dirty' conversion...

Code: [Select]
--[[-------------------------------------------------------
  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

Offline dada87

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Don't know what's wrong
« Reply #3 on: 18 February, 2008, 16:52:31 »
Thank you very much !
I'm going to try and I will let you know if it works.
Thx


/Edit
It works thanks
« Last Edit: 18 February, 2008, 17:23:51 by dada87 »

PtokaX forum

Re: Don't know what's wrong
« Reply #3 on: 18 February, 2008, 16:52:31 »