Author Topic: Block Command script  (Read 2689 times)

0 Members and 1 Guest are viewing this topic.

Offline Creative

  • Fulll Member
  • ****
  • Posts: 73
  • Karma: +8/-3
Block Command script
« on: 13 December, 2006, 09:56:19 »
Hi every1, i wanted some changes in the following script. Like if any user types a command, thn it will be blocked directly without warning and no msg will be shown to him in main or pm and also no msg will be sent to OP or Master.

Also if u can, thn make a change so tht if a user types a command which i hve blocked, thn just the command will be shown in main and tht too every1 can c tht command typed by tht user..........
Code: [Select]
--[[
Quiz-Guardian Version 1.3 Lua 5.02/5.1 by Toobster?? 03/07/2006
As requested by Silverback??
Thanks to American Idiot For Help on Conversion to 5.1
***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked
]]--
--================Config Settings ================================
Bot = "Quiz-Guardian" -- Bot Nick
HubOwner = "Toobster??" -- Hub Owner Nick
HubName = frmHub:GetHubName()
--================Blocked Commands=============================
Blocked = {
"triviascorereset",
"trivstart",
"trivstop",
}
--================How Offender Is Punished========================
-- ( 0=Warn / 1=Disconnect / 2=Kick / 3=Ban)
Action = 1
--================DO NOT EDIT BELOW==========================
function ChatArrival(user, data)
if user.sName ~= HubOwner then
data = string.lower(data)
for id, word in ipairs(Blocked) do
if string.find(data, word, 1, 1) then
SendPmToNick(HubOwner, Bot, user.sName .." Is Messing With Trivia in "..HubName..
", Here Is The Proof - " ..data)
user:SendPM(HubOwner,  "THIS IS AN AUTO RESPONSE MESSAGE \r\n\r\n You have been "..
"reported for messing with Quiz,DO NOT do it again \r\n\r\n Here is the proof: " ..data)
local action = Actions[Action](user,data)
SendPmToOps(Bot, user.sName.." ( "..user.sIP.." )  is "..action.." by "..HubOwner..
" because - Fucking With My Quiz" ..data)
return 1
end
end
end
end
 


PtokaX forum

Block Command script
« on: 13 December, 2006, 09:56:19 »

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 725
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Block Command script
« Reply #1 on: 13 December, 2006, 16:27:53 »
Please use proper English in the forums, I had a hard time decrypting your post. :)
Everything could have been anything else and it would have just as much meaning.

Offline Alexinno

  • Double Ace
  • *
  • Posts: 113
  • Karma: +13/-2
  • -= Hard work makes dreams come true =-
    • IlogicGroup Webserver
Re: Block Command script
« Reply #2 on: 13 December, 2006, 21:09:52 »
Hi every1, i wanted some changes in the following script. Like if any user types a command, thn it will be blocked directly without warning and no msg will be shown to him in main or pm and also no msg will be sent to OP or Master.

Also if u can, thn make a change so tht if a user types a command which i hve blocked, thn just the command will be shown in main and tht too every1 can c tht command typed by tht user..........

my english is bad too , but i can't understand almost nothing from he's request :D

Offline Dessamator

  • Scripter
  • Emperor
  • ******
  • Posts: 1 262
  • Karma: +13/-9
Re: Block Command script
« Reply #3 on: 13 December, 2006, 21:22:19 »
Im not sure , but I think he doesnt want the ops to be reported when a blocked command is typed,and he wants the command to be seen by all users.
Ignorance is Bliss.

Offline achiever

  • Lord
  • ***
  • Posts: 260
  • Karma: +25/-22
Re: Block Command script
« Reply #4 on: 14 December, 2006, 16:02:46 »
hi,

lol i did not think ppl here could become so much dum in understanding things  :D

well swapy i have tried to make the changes u asked for:-
note:- this my first try at a script so bare with me if this wont work  ;)
Code: [Select]
--[[
Quiz-Guardian Version 1.3 Lua 5.02/5.1 by Toobster?? 03/07/2006
As requested by Silverback??
Thanks to American Idiot For Help on Conversion to 5.1
***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked
]]--
--================Config Settings ================================
Bot = "Quiz-Guardian" -- Bot Nick
HubOwner = "Toobster??" -- Hub Owner Nick
HubName = frmHub:GetHubName()
--================Blocked Commands=============================
Blocked = {
"triviascorereset",
"trivstart",
"trivstop",
}
--================Main Function=============================
function ChatArrival(user, data)
if user.sName ~= HubOwner then
data = string.lower(data)
for id, word in ipairs(Blocked) do
if string.find(data, word, 1, 1) then
return 1
end
end
end
end

this wont make the command seen by all but should work otherwise  :)

bye,

achiever
thks,
achiever.

Offline Creative

  • Fulll Member
  • ****
  • Posts: 73
  • Karma: +8/-3
Re: Block Command script
« Reply #5 on: 21 December, 2006, 11:30:36 »
dude, it works fine but if i wanna block commands like +astop or +nstop thn it doesnt works..........

Offline achiever

  • Lord
  • ***
  • Posts: 260
  • Karma: +25/-22
Re: Block Command script
« Reply #6 on: 21 December, 2006, 15:52:46 »
dude, it works fine but if i wanna block commands like +astop or +nstop thn it doesnt works..........

plzz make sure of this
***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked


and post ur progress  :)

mean while here is the other version of script which will block command according to profiles
Code: [Select]
--[[***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked
]]--
-================Config Settings ================================
Bot = "Quiz-Guardian" -- Bot Nick
HubOwner = "Toobster??" -- Hub Owner Nick
HubName = frmHub:GetHubName()
--================Blocked Commands=============================
Blocked = {
"triviascorereset", --add ur commands here
"numstop",
"astop",
}
--================Main Function=============================
function ChatArrival(user, data)
if user.iProfile ==  3 then --profile is set to reg
if user.sName ~= HubOwner then
data = string.lower(data)
for id, word in ipairs(Blocked) do
if string.find(data, word, 1, 1) then
user:SendData("***Write ur message here ")
return 1
end
end
end
end
end

and block commands according to file share size of user
Code: [Select]
--[[***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked
thks to SNOOZE for all the help  ;)
]]--
-================Config Settings ================================
Bot = "Quiz-Guardian" -- Bot Nick
HubOwner = "Toobster??" -- Hub Owner Nick
HubName = frmHub:GetHubName()
--================Blocked Commands=============================
Blocked = {
"triviascorereset", --add ur commands here
"numstop",
"astop",
}
--================Main Function=============================
function ChatArrival(user, data)
if (user.iShareSize/1024/1024/1024) < 1 then --this size is in gb
if user.sName ~= HubOwner then
data = string.lower(data)
for id, word in ipairs(Blocked) do
if string.find(data, word, 1, 1) then
user:SendData("*** Write ur message here  ")
return 1
end
end
end
end
end
all the sugestions to change and improve are most welcome  :)

achiever
thks,
achiever.

PtokaX forum

Re: Block Command script
« Reply #6 on: 21 December, 2006, 15:52:46 »