PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Snooze on 14 February, 2004, 16:14:13

Title: Invitation script (read more inside)
Post by: Snooze on 14 February, 2004, 16:14:13
Hey guys,

Once again im in need of your expert advice/help.

Im looking for a script that will do the following:

Send a PM or private msg in the hub when a user with the following specs enters

1) Not regged in hub
2) Not an Op
3) Have xx GB or more

I know that there is scripts out there that will do parts of this, but as my lua skills are limited I have not yet succeded in this.

I would prefer that the msg is called from a txt file and that the msg could be both triggered and send as adefault msg.

Any help will be great :)


/Snooze
Title:
Post by: nErBoS on 14 February, 2004, 16:34:52
Hi,

Hope it helps....

-- Requested by Snooze
-- Made by nErBoS

Bot = "PMmer"
bshare = "bshare.txt" -- In script folder

BigShare = 8 -- In GB

function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(user)
if not(GetProfileName(user.iProfile) == "Reg" or GetProfileName(user.iProfile) == "Vip") then
s,e,share = strfind(user.sMyInfoString, "$MyINFO $ALL [^$]+$ $[^$]*$[^$]*$([^$]+)")
share = share / (1024*1024*1024)
if (share >= BigShare) then
Readtextfile(user, bshare)
end
end
end


function Readtextfile(user, file)
    local filecontents = ""
local handle = openfile(file, "r")
if (handle ~= nil) then
local line = read(handle)
while line do
        filecontents = filecontents..line.."\r\n"
line = read(handle)
end
closefile(handle)
      user:SendPM(Bot, filecontents)
end
end

Best regards, nErBoS
Title:
Post by: Snooze on 14 February, 2004, 17:02:15
Thanks nErBoS !

Thats just the help i needed :) I'll just add a trigger section to this one and it will be perfect :D

Thanks again,

/Snooze
Title:
Post by: Smulf on 14 February, 2004, 17:46:43
Thnx nErBoS! greatz script:D Just what I needed...
Title:
Post by: Snooze on 16 February, 2004, 22:06:01
Hey nErBoS,

I've now been running this script for a few days, and just wanted to let you know that its working perfectly !!

Thanks again :-)

**Snooze
Title:
Post by: nErBoS on 17 February, 2004, 00:36:49
Hi,

Don't need to thanks i'm here to help where i can :)

Best regards, nErBoS