PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: MrZ on 29 March, 2004, 17:12:34

Title: send path in a PM
Post by: MrZ on 29 March, 2004, 17:12:34
hia

strugeling with this,,,

curUser:SendData(BotName, "Path: "..path.. ".")

how do i send it in a PM to the user ??

tnx
Title:
Post by: pHaTTy on 29 March, 2004, 17:24:43
QuoteOriginally posted by MrZ
hia

strugeling with this,,,

curUser:SendData(BotName, "Path: "..path.. ".")

how do i send it in a PM to the user ??

tnx

curUser:SendPM(BotName, "Path: "..path.. ".")

optionally u cud do:

SendPmToNick(curUser.sName,BotName, "Path: "..path.. ".")


later,,
Title:
Post by: MrZ on 29 March, 2004, 17:58:00
tnx pth?tty, but still dont work.. it sends the pm to the bot, looks nice but the user wont see it :))

this is what im strugling with (dont laugh :))

-- Modified by nErBoS
-- Operators are now checked as normal users
-- Some extensions added
-- All known bugs fixed by ----------->>> OpiumVolage
 
BotName = "{BadFilesDetecter}"
MessageToSend = " are not allowed in this hub."
time = 3 --Value in minutes
addy = "countrystar.no-ip.com"
--"Wurlitzer.no-ip.com:4411"

Files = {
[".txt"]="No pre-teen here!",
["preteen"]="No pre-teen here!",
["fuck"]="For sharing the word fuck in filenames or folders ! Remove or rename all those words and you're welcome back...",
["nigger"]="For sharing word like nigger in filenames or folders ! Remove or rename all those words and you're welcome back...",
["motherfucker"]="For sharing motherfuck word in filenames or folders ! Remove or rename all those words and you're welcome back...",
[".shn"]="For sharing shn files ! Unshare all your .shn files and you're welcome.Inly .mp3 files allowed.",
[".dll"]="For sharing dll files ! Unshare all your .dll files and you're welcome. Only .mp3 files allowed.",
[".exe"]="For sharing exe files ! Unshare all your .exe files and you're welcome. Only .mp3 files allowed.",
}

function NewUserConnected(curUser)
frmHub:EnableSearchData(1)
for i,v in Files do
curUser:SendData("$Search Hub:"..BotName..random(1, 100) .." F?F?0?1?"..i)
end
end

function DataArrival(curUser, data)
if( strsub(data, 1, 3) == "$SR" ) then
_,_,nick = strfind( data, "\05(%S*)|$" )
local s = 5 + strlen(curUser.sName)
local e = strfind(data, "%d+%s%d+/%d+") - 2
local path = strsub(data, s, e)
local s = 5 + strlen(curUser.sName)
Reason = FindWhat(curUser,data)
if (Reason == "Other files") then return end
-- SendPmToNick(curUser.sName,BotName, "Redirecting.....", "Reason: "..Reason)
-- SendPmToNick(curUser.sName,BotName, "Reason: "..Reason)
-- SendPmToNick(curUser.sName,"Path: "..path.. ".")
SendPmToNick(curUser.sName,BotName "Path: "..path.. ".")
-- curUser:SendData(BotName, "Redirecting.....")
-- curUser:SendData(BotName, "Reason: "..Reason)
-- curUser:SendData(BotName, "Path: "..path.. ".")
-- SendPmToNick(BotName, "*** User "..curUser.sName.." kicked. Reason: "..Reason)
SendPmToNick(curUser.sName, "You were redirected. "..Reason, "You can come back when you have corrected the problem")
-- SendDataToNick(curUser.sName, "Path: "..path.. ".")
-- curUser:Disconnect()
-- curUser:TimeBan(time) --This line tempban a user for an specific amount of time in minutes, to incree/decrease the time change the value in variable 'time'
-- curUser:TempBan() --This line tempban a user for an specific amount of time pre-setted inside ptokax advanced settings, to make it work, uncomment this line and comment the line

above
--SendPmToOps(BotName, "*** User "..curUser.sName.." redirected. Reason: "..Reason)
curUser:SendData("$ForceMove "..addy)
end
end

function FindWhat(curUser,data)
for i,v in Files do
if (strfind(strlower(data), "%"..i.."\005")) then
return v
end
end
return "Other files"
end

im trying to get a pm to the bot with the reason and a Pm to the user with the path and reason,, then i want him to be redirected.

sorry all for messing ur script up, it will be cleaned and notified

Z ya

edited: Yo to To was only a type failure
Title:
Post by: nErBoS on 29 March, 2004, 23:45:16
Hi,

You are missing a ',' in..
SendPmToNick(curUser.sName,BotName "Path: "..path..".")
should be like this..

SendPmToNick(curUser.sName,BotName, "Path: "..path..".")
Best regards, nErBoS
Title:
Post by: MrZ on 30 March, 2004, 12:40:28
hi :)

Tnx a Lot for replying ... funny i missed that simple thing..
will try asap this eve :))

tnx again
Title:
Post by: MrZ on 30 March, 2004, 18:31:59
Hia again

i got the path in a PM but no reason.... I now have this


SendPmToNick(curUser.sName,BotName, "You were redirected. "..Reason, "You can come back when you have corrected the problem")
SendPmToNick(curUser.sName,BotName, "Path: "..path.. ".")

curUser:SendData("$ForceMove "..addy)

any hints ?

Z ya

edited, oh i have tried moved then around whithout luck
Title:
Post by: NightLitch on 30 March, 2004, 19:00:22
QuoteOriginally posted by MrZ
Hia again

i got the path in a PM but no reason.... I now have this


SendPmToNick(curUser.sName,BotName, "You were redirected. "..Reason, "You can come back when you have corrected the problem")
SendPmToNick(curUser.sName,BotName, "Path: "..path.. ".")

curUser:SendData("$ForceMove "..addy)

any hints ?

Z ya

edited, oh i have tried moved then around whithout luck

Yes try this:

SendPmToNick(curUser.sName,BotName, "You were redirected. "..Reason..", "You can come back when you have corrected the problem")
SendPmToNick(curUser.sName,BotName, "Path: "..path.. ".")

curUser:SendData("$ForceMove "..addy)

you forgot .." after Reason.

/NL
Title:
Post by: MrZ on 31 March, 2004, 06:33:57
hia :))

tried that and even added a , instead of a . also a "

SendPmToNick(curUser.sName,BotName, "You were redirected", "..Reason..", "You can come back when you have corrected the problem")

still dont give me any path
Title:
Post by: nErBoS on 31 March, 2004, 13:09:14
Hi,

Try this one..

SendPmToNick(curUser.sName,BotName, "You were redirected. "..Reason.." You can come back when you have corrected the problem")
SendPmToNick(curUser.sName,BotName, "Path: "..path..".")

curUser:SendData("$ForceMove "..addy)

If do not works there is something wrong in the script, post here the scritp exactly how you are using.

Best regards, nErBoS
Title:
Post by: MrZ on 16 April, 2004, 21:16:40
Hia again,,, hope i dont get to enoying now.

I would like to know hoe to make an option so that the script dont check OP's.

Also wondering about the time thing,, does it mean that the script is checkin the hub at special time schedules?

tnx

-- BadFilesDetecter V: 1.0 by [ES]latinmusic. Date: 05/11/2003
-- Base on Illegalist by Ptaczek, Jan-3, 2003
-- Searches for specified patterns. Useful for illegal share checking
-- Modificed by Leo (for music hub)
-- Modified by nErBoS
-- Operators are now checked as normal users
-- Some extensions added
-- All known bugs fixed by ----------->>> OpiumVolage
 
BotName = "{BadFilesDetecter}"
MessageToSend = " are not allowed in this hub."
time = 3 --Value in minutes
addy = "countrystar.no-ip.com"
--"Wurlitzer.no-ip.com:4411"

Files = {
[".txt"]="No pre-teen here!",
["preteen"]="No pre-teen here!",
["fuck"]="For sharing the word fuck in filenames or folders ! Remove or rename all those words and you're welcome back...",
["nigger"]="For sharing word like nigger in filenames or folders ! Remove or rename all those words and you're welcome back...",
["motherfucker"]="For sharing motherfuck word in filenames or folders ! Remove or rename all those words and you're welcome back...",
[".shn"]="For sharing shn files ! Unshare all your .shn files and you're welcome.Inly .mp3 files allowed.",
[".dll"]="For sharing dll files ! Unshare all your .dll files and you're welcome. Only .mp3 files allowed.",
[".exe"]="For sharing exe files ! Unshare all your .exe files and you're welcome. Only .mp3 files allowed.",
}

function Main()
frmHub:RegBot(BotName) -- If you don't want to register the bot remove this line
end

function NewUserConnected(curUser)
frmHub:EnableSearchData(1)
for i,v in Files do
curUser:SendData("$Search Hub:"..BotName..random(1, 100) .." F?F?0?1?"..i)
end
end

function DataArrival(curUser, data)
if( strsub(data, 1, 3) == "$SR" ) then
local s,e,path = strfind(data, "$SR%s+%S+%s+(.+)%x+%s+%x+/%x+")
Reason = FindWhat(curUser,data)
if (Reason == "Other files") then return end

SendPmToNick(curUser.sName,BotName, "You were redirected beacause "..Reason..".")
SendPmToNick(curUser.sName,BotName, "Path: "..path)
SendPmToNick(curUser.sName,BotName, "You can come back when you have corrected the problem")
curUser:SendData("$ForceMove "..addy)
end
end

function FindWhat(curUser,data)
for i,v in Files do
if (strfind(strlower(data), "%"..i.."\005")) then
return v
end
end
return "Other files"
end

Title:
Post by: nErBoS on 17 April, 2004, 01:55:10
Hi,

Done to not check Ops..

-- BadFilesDetecter V: 1.0 by [ES]latinmusic. Date: 05/11/2003
-- Base on Illegalist by Ptaczek, Jan-3, 2003
-- Searches for specified patterns. Useful for illegal share checking
-- Modificed by Leo (for music hub)
-- Modified by nErBoS
-- Operators are now checked as normal users
-- Some extensions added
-- All known bugs fixed by ----------->>> OpiumVolage
 
BotName = "{BadFilesDetecter}"
MessageToSend = " are not allowed in this hub."
time = 3 --Value in minutes
addy = "countrystar.no-ip.com"
--"Wurlitzer.no-ip.com:4411"

Files = {
[".txt"]="No pre-teen here!",
["preteen"]="No pre-teen here!",
["fuck"]="For sharing the word fuck in filenames or folders ! Remove or rename all those words and you're welcome back...",
["nigger"]="For sharing word like nigger in filenames or folders ! Remove or rename all those words and you're welcome back...",
["motherfucker"]="For sharing motherfuck word in filenames or folders ! Remove or rename all those words and you're welcome back...",
[".shn"]="For sharing shn files ! Unshare all your .shn files and you're welcome.Inly .mp3 files allowed.",
[".dll"]="For sharing dll files ! Unshare all your .dll files and you're welcome. Only .mp3 files allowed.",
[".exe"]="For sharing exe files ! Unshare all your .exe files and you're welcome. Only .mp3 files allowed.",
}

function Main()
frmHub:RegBot(BotName) -- If you don't want to register the bot remove this line
end

function NewUserConnected(curUser)
frmHub:EnableSearchData(1)
for i,v in Files do
curUser:SendData("$Search Hub:"..BotName..random(1, 100) .." F?F?0?1?"..i)
end
end

function DataArrival(curUser, data)
if( strsub(data, 1, 3) == "$SR" and not user.bOperator) then
local s,e,path = strfind(data, "$SR%s+%S+%s+(.+)%x+%s+%x+/%x+")
Reason = FindWhat(curUser,data)
if (Reason == "Other files") then return end

SendPmToNick(curUser.sName,BotName, "You were redirected beacause "..Reason..".")
SendPmToNick(curUser.sName,BotName, "Path: "..path)
SendPmToNick(curUser.sName,BotName, "You can come back when you have corrected the problem")
curUser:SendData("$ForceMove "..addy)
end
end

function FindWhat(curUser,data)
for i,v in Files do
if (strfind(strlower(data), "%"..i.."\005")) then
return v
end
end
return "Other files"
end

About this two lines...

MessageToSend = " are not allowed in this hub."
time = 3 --Value in minutes

They aren?t been used on the script.

Bets regards, nErBoS
Title:
Post by: MrZ on 17 April, 2004, 08:05:24
:))))   I ow u a beer nErBoS

tnx dude


(edited. . hmm wonder if it kicks master and owners,,,hehe)