PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: Joker on 03 December, 2003, 13:57:57

Title: Need help with script.
Post by: Joker on 03 December, 2003, 13:57:57
Can anyone tell me why this script dont work with PtokaX TestDrive 4 ?

Code:






bot="SearchNotifier"


trigs = {

lolita="[USER] shares/is looking for lolita porn",
preteen="[USER] shares/is looking for preteen porn",
incest="[USER] shares/is looking for incest porn",
animalsex="[USER] shares/is looking for sex with animals",
animalfuck="[USER] shares/is looking for sex with animals",
horsesex="[USER] shares/is looking for sex with animals",
horsefuck="[USER] shares/is looking for sex with animals",
rape="[USER] shares/is looking for rape stuff",
nazi="[USER] shares/is looking for nazistuff"


}



function DataArrival(user, data)

if ((strlower(strsub(data,1,3))=="$sr")or(strlower(strsub(data,1,7))=="$search")) then

for key, value in trigs do

if( strfind( strlower(data), key) ) then

answer, x = gsub(value, "%b[]", user.sName)
 
SendToAll(bot, answer )

end

end

end

end



Please help me  :(  !
Title:
Post by: pHaTTy on 03 December, 2003, 14:31:52
hi there, well sr i think is SR yes



bot="SearchNotifier"


trigs = {

lolita="[USER] shares/is looking for lolita porn",
preteen="[USER] shares/is looking for preteen porn",
incest="[USER] shares/is looking for incest porn",
animalsex="[USER] shares/is looking for sex with animals",
animalfuck="[USER] shares/is looking for sex with animals",
horsesex="[USER] shares/is looking for sex with animals",
horsefuck="[USER] shares/is looking for sex with animals",
rape="[USER] shares/is looking for rape stuff",
nazi="[USER] shares/is looking for nazistuff"


}



function DataArrival(user, data)

        if ((strlower(strsub(data,1,3))=="$SR")or(strlower(strsub(data,1,7))=="$Search")) then
           
            for key, value in trigs do

        if( strfind( strlower(data), key) ) then

            answer, x = gsub(value, "%b[]", user.sName)
 
            SendToAll(bot, answer )

            end

        end

    end

end


yep that shud work


hmmm im not sure i think search data 1, 13


bot="SearchNotifier"


trigs = {

lolita="[USER] shares/is looking for lolita porn",
preteen="[USER] shares/is looking for preteen porn",
incest="[USER] shares/is looking for incest porn",
animalsex="[USER] shares/is looking for sex with animals",
animalfuck="[USER] shares/is looking for sex with animals",
horsesex="[USER] shares/is looking for sex with animals",
horsefuck="[USER] shares/is looking for sex with animals",
rape="[USER] shares/is looking for rape stuff",
nazi="[USER] shares/is looking for nazistuff"


}



function DataArrival(user, data)

        if ((strlower(strsub(data,1,3))=="$SR")or(strlower(strsub(data,1,13))=="$Search")) then
           
            for key, value in trigs do

        if( strfind( strlower(data), key) ) then

            answer, x = gsub(value, "%b[]", user.sName)
 
            SendToAll(bot, answer )

            end

        end

    end

end



i cud be wrong :/
Title:
Post by: Joker on 03 December, 2003, 14:44:07
Hi.
 I tryed bouth , but they dont do anything.
I need that message to be seen in main chat .
I tryed to search but nothing happend.
Title:
Post by: plop on 03 December, 2003, 14:51:56
frmHub:EnableSearchData(n) ... enables/disables passing of $Search, $MultiSearch and $SR to current script.
your gone need 2 add the next part in the script.
function Main()
frmHub:EnableSearchData(1)
end
plop
Title:
Post by: Joker on 03 December, 2003, 15:00:19
Nope. Still nothin happend.

Script look like this now:


bot="SearchNotifier"


trigs = {

lolita="[USER] shares/is looking for lolita porn",
preteen="[USER] shares/is looking for preteen porn",
incest="[USER] shares/is looking for incest porn",
animalsex="[USER] shares/is looking for sex with animals",
animalfuck="[USER] shares/is looking for sex with animals",
horsesex="[USER] shares/is looking for sex with animals",
horsefuck="[USER] shares/is looking for sex with animals",
rape="[USER] shares/is looking for rape stuff",
nazi="[USER] shares/is looking for nazistuff"


}


function Main()
frmHub:EnableSearchData(1)
end


function DataArrival(user, data)

        if ((strlower(strsub(data,1,3))=="$SR")or(strlower(strsub(data,1,13))=="$Search")) then
           
            for key, value in trigs do

        if( strfind( strlower(data), key) ) then

            answer, x = gsub(value, "%b[]", user.sName)
 
            SendToAll(bot, answer )

            end

        end

    end

end

Title:
Post by: tezlo on 03 December, 2003, 15:46:54
lol..
if strsub(strlower(data), 1, 3) == "$SR" (never)
1, 13 are you making them numbers up ?
the only thing missing was enablesearchdata
trigs = {
lolita="[USER] shares/is looking for lolita porn",
preteen="[USER] shares/is looking for preteen porn",
incest="[USER] shares/is looking for incest porn",
animalsex="[USER] shares/is looking for sex with animals",
animalfuck="[USER] shares/is looking for sex with animals",
horsesex="[USER] shares/is looking for sex with animals",
horsefuck="[USER] shares/is looking for sex with animals",
rape="[USER] shares/is looking for rape stuff",
nazi="[USER] shares/is looking for nazistuff"
}

function Main()
frmHub:EnableSearchData(1)
end

function DataArrival(user, data)
if strsub(data, 1, 3) == "$SR" or strsub(data, 1, 7) == "$Search" then
data = strlower(data)
for key, value in trigs do
if strfind(data, key, 1, 1) then
local answer = gsub(value, "%b[]", user.sName)
SendToAll("mom", answer)
end
end
end
end
Title:
Post by: Joker on 03 December, 2003, 16:25:09
Thank you.
Now it work  :D
Title:
Post by: Joker on 03 December, 2003, 17:11:05
Hi.

What command do i need to use , if i want message only to SU+ , not for OP:s ?

Is there SendPmToSu command or something like that?
I dont know , why i get all messages in main chat , even if i use SendPmToOps commant. Still i get message in main chat.
Title:
Post by: Joker on 07 December, 2003, 20:36:16
Hi.

What command do i need to use , if i want message only to SU+ , not for OP:s ?

Is there SendPmToSu command or something like that?
I dont know , why i get all messages in main chat , even if i use SendPmToOps commant. Still i get message in main chat.
Can anyone please tell me , how can script send warn messages only to hub owner , not for OP:s
Title:
Post by: BlazeXxX on 07 December, 2003, 20:59:22
Hmmm.. I guess it needs a table there in the script.. not sure.. Tezlo,Plop,Phatty,Optimus are the ppl you shoud seek for help on this matter :P
Title:
Post by: tezlo on 07 December, 2003, 21:31:44
here..
function SendPmTo(profile, from, what)
local table = GetUsersByProfile(profile)
for id, name in table do SendPmToNick(name, from, what) end
end

SendPmTo("SuperOP", "botname", "message")

note that if you dont register the botname..
messages will either display in main or get ignored (client issue)
Title:
Post by: BlazeXxX on 08 December, 2003, 02:45:55
Here is something bit more useful, but not tested..


-- Start copying from here
-- Modified by BlazeX
-- Written by Tezlo
Bot = "Granny"

trigs = {
lolita="[USER] shares/is looking for lolita porn",
preteen="[USER] shares/is looking for preteen porn",
incest="[USER] shares/is looking for incest porn",
animalsex="[USER] shares/is looking for sex with animals",
animalfuck="[USER] shares/is looking for sex with animals",
horsesex="[USER] shares/is looking for sex with animals",
horsefuck="[USER] shares/is looking for sex with animals",
rape="[USER] shares/is looking for rape stuff",
nazi="[USER] shares/is looking for nazistuff"
}

function Main()
frmHub:RegBot(Bot)
frmHub:EnableSearchData(1)
end

function DataArrival(user, data)
   if strsub(data, 1, 3) == "$SR" or strsub(data, 1, 7) == "$Search" then
      data = strlower(data)
      for key, value in trigs do
         if strfind(data, key, 1, 1) then
            local answer = gsub(value, "%b[]", user.sName)
            function SendPmTo(SuperOP, Bot, answer)
            local table = GetUsersByProfile(profile)
            for id, name in table do SendPmToNick(cur.sUser, Bot, answer) end
            end
         end
      end
   end
end
Title:
Post by: tezlo on 08 December, 2003, 03:12:03
bot = "search-spy"

trigs = { "lolita", "preteen", "incest", "animalsex", "animalfuck", "horsesex", "horsefuck", "rape", "nazi" }

function Main()
frmHub:RegBot(bot)
frmHub:EnableSearchData(1)
end

function SendPmTo(profile, from, what)
local table = GetUsersByProfile(profile)
for id, name in table do SendPmToNick(name, from, what) end
end

function DataArrival(user, data)
if strsub(data, 1, 3) == "$SR" or strsub(data, 1, 7) == "$Search" then
data = strlower(strsub(data, 9, -1))
SendToNick("tezlo", ">> "..data)
for id, value in trigs do
if strfind(data, value, 1, 1) then
SendPmTo("SuperOP", bot, user.sName.." is looking for: "..value)
end
end
end
end
Title:
Post by: Joker on 08 December, 2003, 17:25:29
Now it work .  :D
Thank you tezlo.