最近我在毀葛想要掛金牌換破錐可是都會再領獎時斷線
automacro initial {
map hugel
exclusive 1
run-once 1
call {
do conf squelchDomains emotion,skill,publicchat
do conf autoTalkCont 0
do conf cachePlayerNames_maxSize 300
$betNumber = 1
# 設定單人魔物賭注號碼 betNumber
$betNumber1 = 1
# 設定雙人魔物賭注號碼1 betNumber1
$betNumber2 = 2
# 設定雙人魔物賭注號碼2 betNumber2
# 以下為隨機選號 (暫時註解掉)
$betNumber = @rand(1,6)
$betNumber1 = @rand(1,6)
$betNumber2 = @rand(1,6)
while ($betNumber2 == $betNumber1) as chooseAgain
$betNumber2 = @rand(1,6)
end chooseAgain
}
}
automacro relogOnNpcNoRespond {
console /無法在座標.*找到 NPC/
exclusive 1
call {
release all
do relog
}
}
automacro dropTicketInHugel {
map hugel
inventory "魔物票券" == 1
run-once 1
call {
do drop @inventory(魔物票券)
pause 3
do move @rand(63,68) @rand(73,78) hugel
}
}
# 單人賽外場進入內場的觸發字句
automacro singleAnnouncement {
location hugel
zeny > 50000
console "魔物賽跑單人賽比賽競賽場入場時間沒剩下多少時間了"
call singleRace
}
# 雙人賽外場進入內場的觸發字句
automacro doubleAnnouncement {
location hugel
zeny > 50000
console /^魔物賽跑雙人賽比賽競賽場/
call doubleRace
}
# 進入單人賽內場,並選擇要賭的號碼
macro singleRace {
lock singleAnnouncement
# lock doubleAnnouncement
do move @rand(63,68) @rand(73,78) hugel
pause @rand(10,20)
do talknpc 58 72 c r1 c c r0 n
pause @rand(10,20)
do move @rand(70,76) @rand(31,36) p_track01
pause @rand(10,20)
# 記錄各魔物素質(暫時註解掉)
do talk @npc (73 22)
pause 1
do talk cont
pause 1
do conf logConsole 1
do talk resp 0
do conf logConsole 0
pause 1
do talknpc 73 22 c r$betNumber n
# 賭號碼為 $betNumber 的魔物會贏
release singleAnnouncement
release doubleAnnouncement
}
# 進入雙人賽內場,並選擇要賭的號碼
macro doubleRace {
$betNumber1Temp = $betNumber1
$betNumber2Temp = $betNumber2
$betNumber1Temp--
$betNumber2Temp--
do eval if ($::Macro::Data::varStack{betNumber1Temp} < $::Macro::Data::varStack{betNumber2Temp}) {$::Macro::Data::varStack{betNumber2Temp}--}
lock singleAnnouncement
lock doubleAnnouncement
pause @rand(10,20)
do move @rand(63,68) @rand(73,78) hugel
pause @rand(10,20)
do talknpc 62 69 c r1 c c r0 n
pause @rand(10,20)
do move @rand(70,76) @rand(31,36) p_track02
pause @rand(10,20)
# 記錄各魔物素質(暫時註解掉)
do talk @npc (73 22)
pause 1
do talk cont
pause 1
do conf logConsole 1
do talk resp 0
do conf logConsole 0
pause 1
do talknpc 73 22 c r1 c c r$betNumber1Temp c r0 c r$betNumber2Temp c r0 n
# 賭魔物的號碼
release singleAnnouncement
release doubleAnnouncement
}
# 單人賽結果揭曉後的觸發
automacro singleBetResult {
location p_track01
inventory "魔物票券" == 1
console /^第1名進來的魔物是 (\d)號 魔物~!!$/
call singleResultProcessing
}
# 雙人賽結果第一名揭曉後的觸發
automacro doubleBetResult1 {
location p_track02
inventory "魔物票券" == 1
console /^(\d)號魔物 有進到終點了$/
call doubleResultProcessing1
}
# 雙人賽結果第二名揭曉後的觸發
automacro doubleBetResult2 {
location p_track02
inventory "魔物票券" == 1
console /^在等(\d)號魔物 跟隨著進到終點的話 競賽就結束了$/
call doubleResultProcessing2
}
# 單人賽記錄並判斷要換獎牌或直接離場
macro singleResultProcessing {
$resultNumber = $.lastMatch1
# 記錄至檔案 /logs/raceResultSingle.txt
do eval if (open(FILE, ">>:utf8", $::Settings::logs_folder . "/raceResultSingle.txt")) {$::Macro::Data::varStack{datetime} = "[".getFormattedDate(int(time))."]";print FILE "\n$::Macro::Data::varStack{datetime} 賭注號碼: $::Macro::Data::varStack{betNumber} 號; 中獎號碼: $::Macro::Data::varStack{resultNumber} 號.";close FILE;}
if ($resultNumber == $betNumber) goto win
# 若號碼為 $betNumber 的魔物跑贏,則去換獎牌
call Exit
goto end
:win
call singleRedemption
:end
}
# 雙人賽記錄第一名魔物並判斷是否要直接離場
macro doubleResultProcessing1 {
$resultNumber1 = $.lastMatch1
if ($resultNumber1 == $betNumber1) goto wait
if ($resultNumber1 == $betNumber2) goto wait
# 若有號碼沒中想先行離場,則請刪除以下兩行行首的井字號
do eval if (open(FILE, ">>:utf8", $::Settings::logs_folder . "/raceResultDouble.txt")) {$::Macro::Data::varStack{datetime} = "[".getFormattedDate(int(time))."]";print FILE "\n$::Macro::Data::varStack{datetime} 賭注號碼: $::Macro::Data::varStack{betNumber1}, $::Macro::Data::varStack{betNumber2}; 中獎號碼: $::Macro::Data::varStack{resultNumber1}, 未知";close FILE;}
call Exit
:wait
}
# 雙人賽記錄第二名魔物並判斷要換獎牌或離場
macro doubleResultProcessing2 {
$resultNumber2 = $.lastMatch1
# 記錄至檔案 /logs/raceResultDouble.txt
do eval if (open(FILE, ">>:utf8", $::Settings::logs_folder . "/raceResultDouble.txt")) {$::Macro::Data::varStack{datetime} = "[".getFormattedDate(int(time))."]";print FILE "\n$::Macro::Data::varStack{datetime} 賭注號碼: $::Macro::Data::varStack{betNumber1}, $::Macro::Data::varStack{betNumber2}; 中獎號碼: $::Macro::Data::varStack{resultNumber1}, $::Macro::Data::varStack{resultNumber2}";close FILE;}
# 判斷要換獎牌或離場
if ($resultNumber1 == $betNumber1) goto halfWin
if ($resultNumber2 == $betNumber1) goto halfWin
call Exit
goto end
:halfWin
if ($resultNumber2 == $betNumber2) goto totallyWin
if ($resultNumber1 == $betNumber2) goto totallyWin
call Exit
goto end
:totallyWin
call doubleRedemption
:end
}
# 若魔物單人賽賭中了,則呼叫此巨集進行獎牌兌換
macro singleRedemption {
#暫停數秒,等待兌換服務人員出現
call ChangeNumberOneStan
pause @rand(10,30)
do talknpc 67 45 c c c c c r0 c n
#兌換 服務人員
call Exit
}
# 若魔物雙人賽賭中了,則呼叫此巨集進行獎牌兌換
macro doubleRedemption {
#暫停數秒,等待兌換服務人員出現
call ChangeNumberOneStan
#........
pause @rand(10,30)
do talknpc 67 45 c c c c r0 c n
#兌換 服務人員
call Exit
}
# 若沒賭中,或換完獎牌後,呼叫此巨集離開內場
macro Exit {
release singleAnnouncement
release doubleAnnouncement
release singleBetResult
release doubleBetResult1
release doubleBetResult2
# 暫停數秒以改善偵測不到退場 NPC
pause @rand(10,30)
do move hugel
pause @rand(10,30)
# 小範圍移動以改善偵測不到入場 NPC
do move @rand(63,68) @rand(73,78) hugel
pause @rand(10,30)
release initial
}
automacro medalChange {
map ein_in01
inventory "神奇的獎牌" > 0
run-once 1
call {
do move 81 206 ein_in01
do talknpc 85 208 c r0 c c c c c r0 c c r1 c c n
# 其中r1為換job值 要換經驗請改為r0
pause 2
release medalChange
}
}
#判斷是否與中獎一樣號碼,如果是,再換一個
macro ChangeNumberOneStan {
:ChangeNumberOne
if ($betNumber != $resultNumber) goto endChangeNumber
# 判斷選用號碼還更新開出來的號碼是否相同. 不相同再去判斷是不是有不要的號碼
$betNumber = @rand(1,6)
#亂數產生1~6的一個號碼
goto ChangeNumberOne
:endChangeNumber
if ($betNumber == 4) goto ChangeNumber4
if ($betNumber == 5) goto ChangeNumber4
#避開自己不想要的號碼(目前是設定4,5)可以自己增加或減少
goto endChangeNumber4
#如果都ok,就可以結束亂碼產生
:ChangeNumber4
$betNumber = @rand(1,6)
#亂數產生1~6的一個號碼
goto ChangeNumberOne
:endChangeNumber4
#結束
}
這是我所複製別人的巨集不過都怪怪的每次贏要領獎牌都會斷線?
是否可以請大大看哪裡要修改~~~謝謝 |