What's new

Anty bot system. HIT!

Status
Not open for further replies.

Chmielu

Active User
Joined
Jun 1, 2008
Messages
58
Reaction score
1
Jak to dzia?a?

Od czasu do czasu gracz otrzymuje wiadomo?? z zadaniem, je?li go nie rozwarze zostanie teleportowany do temple...
yunieantibotcs7.png



Zaczynamy:



W creaturescripts.xml:



Code:
<event type="login" name="AntiBotLogin" script="antibot.lua"/>
<event type="logout" name="AntiBotLogout" script="antibot.lua"/>


Teraz tworzymy w data/creaturescripts/scripts/antibot.lua


Code:
-- configs
[COLOR="RoyalBlue"]local mintoanswer = 2 -- minutes to answer anti bot system[/COLOR]
[COLOR="Magenta"]local delayAntiBot = 30 -- minutes of delay of delayAntiBot[/COLOR]
[COLOR="Red"]local maxgroupid = 1 -- groupid higher than this don't have antiBotSystem[/COLOR] Activated
[COLOR="Lime"]local prisionpos = {x=83,y=122,z=7} -- if don't answer, go to this pos[/COLOR]
[COLOR="DarkOrange"]local prisionminutes = 10 -- time inside the prision[/COLOR]
[COLOR="Gray"]local templepos = {x=95, y=117, z=7} -- after the prisionminutes, back to this position (temple is recommended)[/COLOR]
-- end configs
-- local variables
local storages = {first_num = 20123, second_num = 20124, result = 20125, answer = 20126, prisioned = 20127, prisiontime = 20128, wrong_answers = 20129}
-- end local variables
function onLogin(cid)
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
if (prisioned == 1) then
local prisiontime = getPlayerStorageValue(cid,storages.prisiontime)
local timenow = os.time()
if (timenow >= prisiontime) then
setPlayerStorageValue(cid,storages.prisiontime,0)
setPlayerStorageValue(cid,storages.prisioned,0)
doTeleportThing(cid, templepos)
else
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
doTeleportThing(cid, prisionpos)
end
end
if (delayAntiBot <= mintoanswer) then
debugPrint("Error! Anti Bot System debugs: variable delayAntiBot need to be higher than mintoanswer.")
else
if (getPlayerGroupId(cid) <= maxgroupid) then
antiBotEvent = addEvent(antiBot,1000,{cid=cid})
else
doPlayerSendTextMessage(cid, 20, "People with group ID higher than ".. maxgroupid .." don't have this system.")
end
end
return TRUE
end
function onLogout(cid)
stopEvent(prisionEvent)
stopEvent(antiBotEvent)
stopEvent(checkAnswerEvent)
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.wrong_answers,0)
return TRUE
end
function antiBot(parameters)
local cid = parameters.cid
local playerpos = getCreaturePosition(cid)
local playerpz = getTilePzInfo(playerpos)
local playername = getPlayerName(cid)
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
if (playerpz ~= 1 and prisioned ~= 1) then
local first_num = math.random(1,9)
local second_num = math.random(1,9)
local result = first_num+second_num
setPlayerStorageValue(cid,storages.first_num,first_num)
setPlayerStorageValue(cid,storages.second_num,second_num)
setPlayerStorageValue(cid,storages.result,result)
doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Hello, "..playername.."! You have ".. mintoanswer .." minute(s) to answer how much is ".. first_num .." + ".. second_num ..". To answer say: !antibot \"number.")
doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Example: 20+20 = 40, then you would say !antibot \"40.")
checkAnswerEvent = addEvent(checkAnswer,mintoanswer*60*1000,{cid=cid})
end
antiBotEvent = addEvent(antiBot,delayAntiBot*60*1000,{cid=cid})
end
function checkAnswer(parameters)
local cid = parameters.cid
local first_num, second_num, result, answer, prisioned = getPlayerStorageValue(cid,storages.first_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.result), getPlayerStorageValue(cid,storages.answer), getPlayerStorageValue(cid,storages.prisioned)
local wrong_answers = getPlayerStorageValue(cid,storages.wrong_answers)
if (wrong_answers > 3) then
doTeleportThing(cid, prisionpos)
setPlayerStorageValue(cid,storages.wrong_answers,0)
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.prisioned,1)
setPlayerStorageValue(cid,storages.prisiontime,os.time()+(prisionminutes*60))
doPlayerSendTextMessage(cid, 20, "Time limit! You had been prisioned for ".. prisionminutes .." minute(s) because answered many wrong times.")
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
else
if (answer ~= 1 and prisioned ~= 1 and result > 0) then
doTeleportThing(cid, prisionpos)
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.prisioned,1)
setPlayerStorageValue(cid,storages.wrong_answers,0)
setPlayerStorageValue(cid,storages.prisiontime,os.time()+(prisionminutes*60))
doPlayerSendTextMessage(cid, 20, "Time limit! You had been prisioned for ".. prisionminutes .." minute(s).")
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
else
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.prisioned,0)
setPlayerStorageValue(cid,storages.wrong_answers,0)
doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: You are ok, but in some minutes you are going to be asked again.")
end
end
end
function checkprisioned(parameters)
local cid = parameters.cid
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
local prisiontime = getPlayerStorageValue(cid,storages.prisiontime)
local timenow = os.time()
if (prisioned == 1) then
if (timenow >= prisiontime) then
doPlayerSendTextMessage(cid, 20, "You had completed your time here in the prision! You may now relog to go to the city.")
else
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
end
end
end



Nast?pnie w talkactions.xml



Code:
<talkaction words="!antibot" script="antibot.lua"/>



I na koniec tworzymy w data/talkactions/scripts/antibot.lua



Code:
-- local variables
local storages = {first_num = 20123, second_num = 20124, result = 20125, answer = 20126, prisioned = 20127, prisiontime = 20128, wrong_answers = 20129}
-- end local variables
function onSay(cid, words, param)
local first_num, second_num, result, answer, prisioned = getPlayerStorageValue(cid,storages.first_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.result), getPlayerStorageValue(cid,storages.answer), getPlayerStorageValue(cid,storages.prisioned)
param = tonumber(param)
if (prisioned ~= 1 and answer ~= 1 and result > 0) then
if (param == result) then
if (getPlayerStorageValue(cid,storages.wrong_answers) <= 3) then
doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Right answer, thank you for answering.")
setPlayerStorageValue(cid,storages.wrong_answers,0)
setPlayerStorageValue(cid,storages.answer,1)
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
else
doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Right answer, but you had already answered more than 3 wrong times.")
end
else
doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Wrong answer!")
wrong_answers_now = getPlayerStorageValue(cid,storages.wrong_answers)
setPlayerStorageValue(cid,storages.wrong_answers,wrong_answers_now+1)
doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: You had already got ".. getPlayerStorageValue(cid,storages.wrong_answers).." wrong answers! The limit is 3.")
end
end
end


Kolorami zaznaczy?em opcje do w?asnej edycji... (skrypt nie dla dzieci, prosze nie pytac co to znaczy)

@To nie m?j skrypt, ale je?li pomog?em to prosz? o Rep++
 

Korzonek

Forum friend
Joined
Apr 11, 2008
Messages
940
Reaction score
190
Age
29
Odp: Anty bot system. HIT!

Z?y dzia?
Prosze moderatora o przeniesienie do dzia?y Skrypty!

uhm, nie ucz moderatora co ma robi?, on dobrze wie... // koko
 
Last edited by a moderator:

XisD

User
Joined
Jun 3, 2008
Messages
32
Reaction score
1
Odp: Anty bot system. HIT!

mam pytanie, b?dzie dzia?a? na 8.4 ?
 

Tibionauta

Advanced User
Joined
May 8, 2008
Messages
388
Reaction score
43
Odp: Anty bot system. HIT!

Jeszcze dobry by?oby dodane pyta? typu "stolica Polski?".Skrypt ca?kiem dobry, ale to uniemo?liwia d?u?szego afkowania ;p.
 

Fridek

Active User
Joined
May 1, 2009
Messages
80
Reaction score
2
Odp: Anty bot system. HIT!

Przed chwil? w?a?nie pr?bowa?em na 8.4 na TFS'ie 0.3b3 lecz gdy wpisuje odpowied? zawsze pisze ?e ?le ^^ Mo?na to jako? poprawi? ?
 

WaderoS

Advanced User
Joined
Apr 4, 2008
Messages
219
Reaction score
11
Odp: Anty bot system. HIT!

Nie wiem czy to potrzebne ... jak ka?dy mia?by tak wpisywa? to jest ....
Dla graczy, kt?rzy robi? questy typu anni, dhq, poi czy inq czy expia na silniejszych potworach i nie wpisz? to tp do temple hm ...

Ja ju? da?em taki skrypt wcze?niej tylko, ?e dla trenuj?cych tylko.
http://tibia.net.pl/inne-skrypty/91044-anty-bot-system.html
 

szymonxdd

New User
Joined
May 27, 2009
Messages
3
Reaction score
0
Odp: Anty bot system. HIT!

0/10

Ludzie by expili i by padali co 30 minut bo im by si? takie okienko w??cza?o...:curse:
 

Miki

HardcorowyKoksu
Joined
Jun 27, 2008
Messages
1,302
Reaction score
226
Age
30
Odp: Anty bot system. HIT!

Hmm ciekawy skrypcik, przyda si? z pewno?ci? wielu ludziom. Zdaje m si?, ?e ju? gdzie? by? taki skrypt. Lecz nie jestem tego pewien.

@up
Jednak kto? ma 2 minuty na odpowied?, wi?c spokojnie by zd??y? moim zdaniem.

Pozdrawiam.
 

Davu

New User
Joined
Apr 25, 2009
Messages
5
Reaction score
1
Odp: Anty bot system. HIT!

Skrypt ?wietny dzia?a mi w 100%
 

pera

Advanced User
Joined
Apr 19, 2008
Messages
189
Reaction score
4
Age
31
Odp: Anty bot system. HIT!

Fajny skrypt na pewno sie komu? przyda, a do tego mo?na przywykn??.

Pozdrawiam!
 

Scavenger

Active User
Joined
May 22, 2009
Messages
70
Reaction score
3
Odp: Anty bot system. HIT!

w jakim? stopniu napewno uniemo?liwi?by stawianie bot?w, ale przeszkadza?oby ludziom w expieniu, wykonywaniu quest?w...
Takie jest moje zdanie, ale gratulacje.
 

Astra Litt

Active User
Joined
Jun 7, 2009
Messages
80
Reaction score
8
Odp: Anty bot system. HIT!

Z?y dzia?,ale fajny pomys? podobny widzia?em na Triasot.pl tylko, ?e z Training monkami.
 

Chmielu

Active User
Joined
Jun 1, 2008
Messages
58
Reaction score
1
Odp: Anty bot system. HIT!

refresh, moze komus sie przyda jeszcze
 

bezercer

New User
Joined
Aug 23, 2008
Messages
5
Reaction score
2
Odp: Anty bot system. HIT!

skrypt dobry ale u mnie nie dziala za ka?dym razem pisze ze z?y kod a 9+5 przeciez jest 14 wie ktos jak to naprawi?
 

BoBeK Roxx

Active User
Joined
Dec 16, 2008
Messages
116
Reaction score
3
Odp: Anty bot system. HIT!

Bardzo sie przyda : ), nie bedzie w ogole botterow ;p jakies 60% mniej roboty dla gma Xd

To tez sobie wrzuce na otsa wielkie dzieki !!!
 

Sunrise

New User
Joined
May 18, 2008
Messages
3
Reaction score
0
Odp: Anty bot system. HIT!

skrypt beznadziejny cho? pomys? dobry... wyobra? sobie ob... goni kogo? 10 os?b z przeciwnej gildi nagle kole? specjalnie nie wpisuje kodu i ma tp do temple... to rozwi?zanie jest bezsensowne bo jak ma dobrego bota to mu spowrotem przyjdzie na expa.
Aktualnie gram na otsie gdzie jest to ca?kiem inaczej i szczerze m?wi?c bardzo fajnie rozwi?zane, poprostu wy?wiatla si? nast?puj?cy komunikat

05:46 Please type '/train 4475' to prove that you are actually playing the game.
Not doing so will get you banned for 3 hours.

liczba oczywi?cie jest losowa i za ka?dym razem inna, je?li si? nie wpisze komendy w ci?gu 5min dostaje sie bana na 3h... dodam jeszcze ?e dzia?a to tylko jak stoimy na trainerach, wi?c nie ma obaw ?e wyskoczy to komu? podczas expa :D
 

Hocus

New User
Joined
Jun 25, 2009
Messages
4
Reaction score
0
Odp: Anty bot system. HIT!

Mam pytanie. Czy to b?dzie chodzi?o na 8.5??
 

dathan

New User
Joined
Jul 26, 2009
Messages
7
Reaction score
0
Age
33
Odp: Anty bot system. HIT!

mam pytanie identycne jak kolega wy?ej :)

//Tak -_- Ka?dy skrypt od 8.3 w g?r? b?dzie dzia?a? tak?e i na nowszych wersjach TFS.
 
Last edited by a moderator:
Status
Not open for further replies.
Top