PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: [G-T-E]Gate? on 16 March, 2004, 23:30:18

Title: PM to VIPs ONLY upon Entre
Post by: [G-T-E]Gate? on 16 March, 2004, 23:30:18
Iam in need of a script/Bot that will send a PM to ONLY VIP Profile once they connect to the hub.
Then once they have read the PM they have to send a receipt back to the bot which the Master will only see.

The script will also include a Timer ( PM sent every 30min to VIP until they have sent a receipt then it will be deactivated to just that VIP that has sent hi/her receipt)
Running 3.2.6TD4 and Mean_Machine v2.1.2.2
If my wish isnt understandable I'll try again..
Greatfull in advanced
[G-T-E]Gate?
Title:
Post by: NightLitch on 16 March, 2004, 23:38:24
Well I understand you, but I don't understand why you want it like that ? why ?
Title:
Post by: [G-T-E]Gate? on 16 March, 2004, 23:55:35
Fair enough question NightLitch,
Skrollster is working on a script that Iam going to implament to my hub and I need to send a Messeege to the VIP s? I can know what ISP they have and then edit their Registeration. Thread is here >>
 Check it out (http://board.univ-angers.fr/thread.php?threadid=1598&boardid=13&styleid=1&page=2)
will explain more if needed..
Night Owl up late

[G-T-E]Gate?
Title:
Post by: Skrollster on 17 March, 2004, 01:01:38
don't have time to this now, and will probably not have for the rest of the week... have a lot to do now forward... :(
Title:
Post by: [G-T-E]Gate? on 17 March, 2004, 01:12:27
Skrollster thanks anyway for reading the thread.
 I know that time is short, Iam pushing 50 and between work and Play it feels..
Will be on the look out when u got time ..
Ha det :)
Title:
Post by: ??????Hawk?????? on 17 March, 2004, 01:42:27
this should do what your wanting m8  :-




-----------------------------------------
--Vip Message on Entry
--a confirmed message will pm the hub owner and stop spamming the vip
-- a reminder pm will be sent every hr to confirm
-- By ??????Hawk?????? 17-3-04
-----------------------------------------
HubOwner = "Your-Nick"
Botname = "entrance_confirm"
Message = "  blahh blahh  waffle  waffle .. please confim this message by typing    ' confirmed '  with out the '"
arrVips = {}
hrs = 1000 * 60 * 60


function Main()
frmHub:RegBot(Botname)
SetTimer(hrs)
StartTimer()
end

function NewUserConnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot == "VIP" then
curUser:SendPM(Botname, Message)
if (not arrVips[curUser.sName]) then
arrVips[curUser.sName] = 1
end
end
end

function DataArrival(curUser, data)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot == "VIP" then
local s, e, sTo = strfind(data, "^%$To: (%S+)")
if sTo ~= Botname then
return 1
else
local s,e,cmd,d = strfind(data, "%b<>%s+(%S+)(%S+)")
if cmd == "confirmed" then
if (arrVips[curUser.sName]) then
arrVips[curUser.sName] = nil
SendPmToNick( HubOwner, Botname, curUser.sName.." has just confirmed they have read the message." )

end
end
end
end
end
 

function OnTimer()
for vips, value in arrVips do
SendPmToNick( vips, Botname, Message )
end
end



Title: Vip Message on Entry by Hawk 17-3-04
Post by: [G-T-E]Gate? on 17 March, 2004, 23:19:12
Thanks Hawk for ur work I really appreciate it ...

One Question, I want to make a duplicate of the script(same idea) but instead have
the messege sent to normal users can u show me what has to be changed.
Iam using Mean Machine v2.1.2.2 and 326TD4
Ty    :]
Title:
Post by: ??????Hawk?????? on 17 March, 2004, 23:25:48
hmmm  not tested  but i think this should work

set to work on normal users and ignore VIP's





-----------------------------------------
--Vip Message on Entry
--a confirmed message will pm the hub owner and stop spamming the user
-- a reminder pm will be sent every hr to confirm
-- By ??????Hawk?????? 17-3-04
-----------------------------------------
HubOwner = "Your-Nick"
Botname = "entrance_confirm"
Message = "  blahh blahh  waffle  waffle .. please confim this message by typing    ' confirmed '  with out the '"
arrVips = {}
hrs = 1000 * 60 * 60


function Main()
frmHub:RegBot(Botname)
SetTimer(hrs)
StartTimer()
end

function NewUserConnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot ~= "VIP" then
curUser:SendPM(Botname, Message)
if (not arrVips[curUser.sName]) then
arrVips[curUser.sName] = 1
end
end
end

function DataArrival(curUser, data)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot ~= "VIP" then
local s, e, sTo = strfind(data, "^%$To: (%S+)")
if sTo ~= Botname then
return 1
else
local s,e,cmd,d = strfind(data, "%b<>%s+(%S+)(%S+)")
if cmd == "confirmed" then
if (arrVips[curUser.sName]) then
arrVips[curUser.sName] = nil
SendPmToNick( HubOwner, Botname, curUser.sName.." has just confirmed they have read the message." )

end
end
end
end
end
 

function OnTimer()
for vips, value in arrVips do
SendPmToNick( vips, Botname, Message )
end
end

Title:
Post by: [G-T-E]Gate? on 17 March, 2004, 23:40:49
Hawk , Iam not sure if Im going blind of just aged some more but the 2 script look very much alike , no change , usersprofile is still messege to VIP in both. Please tell me Iam wrong and where.
function NewUserConnected(curUser)
   LevelBot = GetProfileName(curUser.iProfile)
      if LevelBot ~= "VIP" then
         curUser:SendPM(Botname, Message)
         if (not arrVips[curUser.sName]) then
            arrVips[curUser.sName] = 1
Title:
Post by: ??????Hawk?????? on 17 March, 2004, 23:49:36
lol  yeh not too bigger change but

notice the 2 lines
if LevelBot == "VIP" then
this is, if it equals VIP


changed to:-

if LevelBot ~= "VIP" then
this is, if it does not equal VIP
Title: Ty
Post by: [G-T-E]Gate? on 17 March, 2004, 23:58:02
OKay , u got me Ty
Title: Vip Message on Entry
Post by: [G-T-E]Gate? on 18 March, 2004, 00:10:59
OK just ran a test on both scripts.
They work perfectly sending the messege to the correct Profile and the confirmed messege is received by Hub Owner.
Just one problem though, Ever time the VIP or NonVIP reconnects to the hub he gets the messege again and again.
Now how to get the script to reconise that the User has confirmed as not to send it back again...
In no rush , will be keeping an eye out for a responce.
Great work so far and Damn  quick if I may say so, Cheers  :D
Title:
Post by: ??????Hawk?????? on 18 March, 2004, 00:56:26
try this m8.  




-----------------------------------------
--Vip Message on Entry
--a confirmed message will pm the hub owner and stop spamming the VIP
-- a reminder pm will be sent every hr to confirm
-- By ??????Hawk?????? 17-3-04
-----------------------------------------
HubOwner = "Your-Nick"
Botname = "entrance_confirm"
Message = "  blahh blahh  waffle  waffle .. please confim this message by typing    ' confirmed '  with out the '"
arrVips = {}
arrStore = {}
hrs = 1000 * 60 * 60


function Main()
frmHub:RegBot(Botname)
SetTimer(hrs)
StartTimer()
end

function NewUserConnected(curUser)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot == "VIP" then
if (not arrStore[curUser.sName]) then
curUser:SendPM(Botname, Message)
if (not arrVips[curUser.sName]) then
arrVips[curUser.sName] = 1
end
end
end
end

function DataArrival(curUser, data)
LevelBot = GetProfileName(curUser.iProfile)
if LevelBot == "VIP" then
local s, e, sTo = strfind(data, "^%$To: (%S+)")
if sTo ~= Botname then
return 1
else
local s,e,cmd,d = strfind(data, "%b<>%s+(%S+)(%S+)")
if cmd == "confirmed" then
if (arrVips[curUser.sName]) then
arrVips[curUser.sName] = nil
arrStore[curUser.sName] = 1
SendPmToNick( HubOwner, Botname, curUser.sName.." has just confirmed they have read the message." )

end
end
end
end
end
 

function OnTimer()
for vips, value in arrVips do
SendPmToNick( vips, Botname, Message )
end
end


Title:
Post by: [G-T-E]Gate? on 18 March, 2004, 10:11:54
Thanks HK will run the test after work..
Cheers