PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: [DK]DjBent on 19 April, 2004, 21:58:02

Title: A Login Script
Post by: [DK]DjBent on 19 April, 2004, 21:58:02
Looks like this....

BotName = "[MMZ]Bot" --// Set here your bot name

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"
local s,e,share = strfind(user.sMyInfoString, "$(%d+)%$")
share = format("%0.2f", ( share / (1024*1024*1024)))
local hubshare = format("%0.2f", ( frmHub:GetCurrentShareAmount() / (1024*1024*1024)))
border1 = "<>=========================H=U=B==I=N=F=O==============================="
border2 = "<>======================================================================"
disp = "\r\n\r\n"..border1.."\r\n"
disp = disp.." ?Welcome: "..user.sName.."\r\n"
disp = disp.." ?To this fine place Called: "..frmHub:GetHubName().."\r\n"
disp = disp.." ?Your IP: "..user.sIP.."\r\n"
disp = disp.." ?Your Status in this Hub: "..doGetProfile.."\r\n"
disp = disp.." ?Actual Share in the Hub: "..hubshare.." GB\r\n"
disp = disp.." ?There are now: "..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users connected\r\n"
disp = disp.." ?Hub description is: "..frmHub:GetHubDescr().."\r\n"
disp = disp.." ?Hub register address is: "..frmHub:GetRegServer().."\r\n"
disp = disp.." ?Hub minshare is: "..frmHub:GetMinShare()/(1024).." GB\r\n"
disp = disp.." ?Redirect address is: "..frmHub:GetRedirectAddress().."\r\n"
disp = disp.." ?Hub is Powered by: "..frmHub:GetHubBotName().."\r\n"..border2.."\r\n"
user:SendData(BotName, disp)
end



But it wont get the bot name..... and i would like it to do that..... or say that the hub is powered by Robocop 7.0a

Please help me, don't know much about scripting in lua
Title:
Post by: nErBoS on 20 April, 2004, 03:10:22
Hi,

The script is working. What is your dioubt or request ???
A new name to the bot ??? just write the name in this line..

BotName = "[MMZ]Bot" --// Set here your bot name
Best regards, nErBoS
Title: a login script
Post by: [DK]DjBent on 20 April, 2004, 06:47:30
<[MMZ]Bot>

- <>=========================H=U=B==I=N=F=O===============================
   ?Welcome:         [MA]DjBent
   ?To this fine place Called:   Sharezone
   ?Your IP:         xxxxxxxxx
   ?Your Status in this Hub:   Master
   ?Actual Share in the Hub:   0.00 GB
   ?There are now:         1 of 20 users connected
   ?Hub description is:      Share lots of Music And have Fun
   ?Hub register address is:   dreamland.gotdns.org;vandel405.dynip.com
   ?Hub minshare is:      10 GB
   ?Redirect address is:      xxxxxx_xxx.yaboo.dk
   ?Hub is Powered by:      
- <>======================================================================
Title: a login script
Post by: [DK]DjBent on 20 April, 2004, 06:49:38
Now you see what i mean.....

the bot name isn't in there and i want it to show i'm using Robocop 7.0a...But don't know how
Title:
Post by: nErBoS on 20 April, 2004, 09:57:19
Hi,

Ok then try this...

BotName = "[MMZ]Bot" --// Set here your bot name
uBot = "RoboCop 7.0" --Set here the Bot that you are using

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"
local s,e,share = strfind(user.sMyInfoString, "$(%d+)%$")
share = format("%0.2f", ( share / (1024*1024*1024)))
local hubshare = format("%0.2f", ( frmHub:GetCurrentShareAmount() / (1024*1024*1024)))
border1 = "<>=========================H=U=B==I=N=F=O==============================="
border2 = "<>======================================================================"
disp = "\r\n\r\n"..border1.."\r\n"
disp = disp.." ?This Hub is using: "..uBot.."\r\n"
disp = disp.." ?Welcome: "..user.sName.."\r\n"
disp = disp.." ?To this fine place Called: "..frmHub:GetHubName().."\r\n"
disp = disp.." ?Your IP: "..user.sIP.."\r\n"
disp = disp.." ?Your Status in this Hub: "..doGetProfile.."\r\n"
disp = disp.." ?Actual Share in the Hub: "..hubshare.." GB\r\n"
disp = disp.." ?There are now: "..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." users connected\r\n"
disp = disp.." ?Hub description is: "..frmHub:GetHubDescr().."\r\n"
disp = disp.." ?Hub register address is: "..frmHub:GetRegServer().."\r\n"
disp = disp.." ?Hub minshare is: "..frmHub:GetMinShare()/(1024).." GB\r\n"
disp = disp.." ?Redirect address is: "..frmHub:GetRedirectAddress().."\r\n"
disp = disp.." ?Hub is Powered by: "..frmHub:GetHubBotName().."\r\n"..border2.."\r\n"
user:SendData(BotName, disp)
end

Best regards, nErBoS
Title: a login script
Post by: [DK]DjBent on 20 April, 2004, 10:21:36
Dosen't seem to work..... now i get nothing wnen i log in...
Title:
Post by: nErBoS on 20 April, 2004, 10:38:33
Hi,

Sorry some syntax error on writing by me.. try it agian now i have edit the last script.

Best regards, nErBoS
Title: a login script
Post by: [DK]DjBent on 20 April, 2004, 11:09:26
I have tryed the edited version and i get nothing in the hub when i log in...
Title:
Post by: [DK]DjBent on 20 April, 2004, 11:10:28
this is what i get now.....

___________________________________________________________________________________________________________
___________________________________________________________________________________________________________


[11:09] Logged in.
[11:09] // Type !help in main for your available commands!
[11:09] <[MMZ]Bot> The Hubowner [MA]DjBent has entered the Hub, Welcome Home.
Title:
Post by: [DK]DjBent on 20 April, 2004, 11:37:06
i get this syntax error


Syntax Error: attempt to concat global `dips' (a nil value)
Title:
Post by: Skrollster on 20 April, 2004, 11:50:10
check so that you haven't change a variablename to dips from disp
Title:
Post by: [DK]DjBent on 20 April, 2004, 12:27:25
Thanks a lot for the help... got it to work now