PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: OpiumVolage on 10 October, 2003, 23:39:36

Title: Disclamer bot
Post by: OpiumVolage on 10 October, 2003, 23:39:36
-- vim:ts=4:sw=4:noet:syntax=lua
-- Disclamer Bot. (OpiumVolage 26/09/2003)

tabAccept = {}
msgOui = "I AGREE"

tabCommands = { "ConnectToMe", "MultiConnectToMe", "RevConnectToMe", "Search", "MultiSearch" }

function Main()
frmHub:EnableFullData(1)
end

function NewUserConnected(user)
if user.iProfile > 0 then return end
user:SendData("Disclamer", "Envoyez un message contenant "..msgOui.." dans le Chat Central pour valider toutes les fonctionnalit? du hub.")
tabAccept[user.sName] = 1
end

function DataArrival(user, data)
-- On teste le niveau de l'utilisateur.
if (user.iProfile > 0) or not tabAccept[user.sName] then return end
if strfind(data, "^%b<>%s+"..msgOui) then
tabAccept[user.sName] = nil
user:SendData("Disclamer", "Merci d'avoir accept?.")
return 1 end
local s, e, cmd = strfind(data, "^$(%S+)")
return foreach(tabCommands, function(id, value)
if value == %cmd then return 1 end end)
end
Title:
Post by: BlazeXxX on 19 October, 2003, 04:23:24
WoW :D

I have been looking for something like this.. Great work m8 :)
Title: Disclaimer-bot
Post by: BaNdiT on 10 November, 2003, 19:03:19
Do we have an English translation of this please?

would appreciate it

 :)  :)  :)  :)  :)  :)  :)  :)  :)  :)
Title:
Post by: OpiumVolage on 10 November, 2003, 22:58:12
[-- vim:ts=4:sw=4:noet:syntax=lua
-- Disclamer Bot. (OpiumVolage 26/09/2003)

tabAccept = {}
msgOui = "I AGREE"

tabCommands = { "ConnectToMe", "MultiConnectToMe", "RevConnectToMe", "Search", "MultiSearch" }

function Main()
frmHub:EnableFullData(1)
end

function NewUserConnected(user)
if user.iProfile > 0 then return end
user:SendData("Disclamer", "Send a message containing "..msgOui.." in CC to enable full hub.")
tabAccept[user.sName] = 1
end

function DataArrival(user, data)
-- On teste le niveau de l'utilisateur.
if (user.iProfile > 0) or not tabAccept[user.sName] then return end
if strfind(data, "^%b<>%s+"..msgOui) then
tabAccept[user.sName] = nil
user:SendData("Disclamer", "Thank you to agree.")
return 1 end
local s, e, cmd = strfind(data, "^$(%S+)")
return foreach(tabCommands, function(id, value)
if value == %cmd then return 1 end end)
end
Title: Disclaimer
Post by: BaNdiT on 11 November, 2003, 17:19:19
thank you OpiumVolage.

I appreciate your help.

keep up the good work

 :)  :)  :)  :)  :)  :)  :)  :)  :)  :)
Title:
Post by: acethecase on 21 April, 2004, 12:27:22
Syntax error: expected;
  last token read: `[' at line 1 in string "[-- vim:ts=4:sw=4:noet:syntax=lua..."
Title:
Post by: nErBoS on 21 April, 2004, 12:44:35
Hi,

Remove "[" in this line...

[-- vim:ts=4:sw=4:noet:syntax=lua
Best regards, nErBoS
Title:
Post by: DoD_Owner on 25 April, 2004, 01:14:50
Will someone please guide me trough using this script ??

When I add this, and then connect to the hub I get disconnected right away...

//DoD_Owner