You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

karmakarma

Master Procrastinator

  • "karmakarma" started this thread

Posts: 442

Location: Miami

Occupation: Diesel Mechanic (semi-trucks/tractor-trailers)

  • Send private message

1

Sunday, September 29th 2013, 4:15am

blacklist addon help needed..

im trying to get an addon im making to work based off chat, basically what it is supposed to do is monitor " /Yell and /say " chats and black list anyone one that use a certain phrase such as "cheap gold".

im aware there are several addons but they only hide the chat from what i found

this code is the closest i have gotten in hours

Source code

1
2
3
4
5
6
7
8
9
10
11
if (event == "CHAT_MSG_YELL") then
	if arg1=="lvinn" or "cheap gold" then
		GSBsite() -- just a default chat frame message to know it found a gold spammer
		AddFriend("BadFriend", arg4)
	end
elseif (event == "CHAT_MSG_SAY") then
	if arg1=="lvinn" or "cheap gold" then
		GSBsite()
		AddFriend("BadFriend", arg4)
  	end
end


the problem with that code is it wants to blacklist everyone that talks in say or yell chat

every thing else i have tried gives me string errors except using...

Source code

1
if arg1==TEXT("cheap gold") then


that will only blacklist the spammer if cheap gold is the first thing it says, it wont search the entire chat message that gets posted
LifeFire - Eternal - Grimdal
Mage/Priest/Knight
82/82/82

Give a macro, Take a Macro
Lifefire's Collections

Noguai

Beginner

Posts: 5

Location: Germany

  • Send private message

2

Sunday, September 29th 2013, 8:18pm

This is certainly not the answer you wanted to get, but use Ultimate Blacklist (http://rom.curseforge.com/addons/ultimate-blacklist/) for that. The reason is: You are about to eventually blacklist a lot of spammers, but the default, in-game solution has a limited maximum size. This will cause troubles whenever there are too many spammers, the list got full, or you want to blacklist someone for whatever reason. Ultimate Blacklist therefore manages it's own blacklist, that you can also access and modify via it's configuration gui. It also has a more advanced spam detection algorithm that will help situations where spammers try to get around chat filters.

Regarding your code. The if-statement is the reason your code fails. It consists of:

Source code

1
if evaluation or value then

Lua handles any value different from false or nil as true and because a string (even if it was empty) will cause the second part of your statement to get true your blacklisting code won't get skipped. You probably wanted to write

Source code

1
if arg1=="lvinn" or arg1=="cheap gold" then


Btw. The function TEXT is used to get a localized string from the clients string ressources. It will return the localized string for the key you call the function with, or the key itself, if no matching ressource was found.

karmakarma

Master Procrastinator

  • "karmakarma" started this thread

Posts: 442

Location: Miami

Occupation: Diesel Mechanic (semi-trucks/tractor-trailers)

  • Send private message

3

Sunday, September 29th 2013, 8:42pm

thanks for the help, ill keep trying to get it to work and if i finally give up ill check out ultimate blacklist
LifeFire - Eternal - Grimdal
Mage/Priest/Knight
82/82/82

Give a macro, Take a Macro
Lifefire's Collections

Auros

Professional

Posts: 1,360

Mood: Mellow

  • Send private message

4

Monday, September 30th 2013, 5:51pm

LOL, yeah I need to check into that add-on also as this weekend I got the dreaded, "Your Black List is full".
Govinda P/W/K/M 100x4 :pump:
Wl/R/M/Ch 100x4 :borg:
Wd/W/S 100/100/100
W/M 100/100 Glass Cannon: oh gawd, not again :pinch: ... and numerous others Semi-retired :pillepalle: