Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

-- Auto Generate World + Setup by Mikel

worldLetter = 8
worldCount = 4 -- Jumlah world yang di buat
worldLock = 202 -- 202 Small Lock; 204 Big Lock ; 206 Huge Lock
entrance = 5036 -- 224 House Entrance; 5036 Hidden Door; 7164 Red house entrance;
door = 858 -- 858 Screen door; 12 door;
doorId = 'idworld'
useJammer = false -- kalau tidak ada jammer auto false
webHookUrl = "webHooklink"

function webHook(content, nickname)


color = 7405312
local script = [[
$w = "]]..webHookUrl..[["
[Net.ServicePointManager]::SecurityProtocol =
[Net.SecurityProtocolType]::Tls12
[System.Collections.ArrayList]$embedArray = @()
$descriptions = ']].. content ..[['
$color = ']]..color..[['
$embedObject = [PSCustomObject]@{
description = $descriptions
color = $color
}
$embedArray.Add($embedObject) | Out-Null
$Body = [PSCustomObject]@{
embeds = $embedArray
'username' = ']]..nickname..[['
}
Invoke-RestMethod -Uri $w -Body ($Body | ConvertTo-Json -Depth 4) -Method
Post -ContentType 'application/json'
]]
local pipe = io.popen("powershell -command -", "w")
pipe:write(script)
pipe:close()

end

function generateWorld()
local nameWorld = ""
for i = 1,worldLetter do
nameWorld = nameWorld..string.char(math.random(97,122))
end
sleep(500)
sendPacket("action|join_request\nname|"..nameWorld.."\ninvitedWorld|0",3)
sleep(5000)
end

function checkWorld()
for _,check in pairs(getTiles()) do
if check.fg == 242 or check.fg == 9640 or check.fg == 202 or check.fg
== 204 or check.fg == 206 then
return false
end
end
return true
end
--(- kiri + kanan) , (- atas + bawah)
-- place(id,x,y)
function setupWorld()
while getTile(math.floor(getBot().x / 32)-2, math.floor(getBot().y /
32)+1).fg ~= 0 or getTile(math.floor(getBot().x / 32)-2, math.floor(getBot().y /
32)+1).bg ~= 0 do
punch(-2,1)
sleep(150)
end

while getTile(math.floor(getBot().x / 32)-1, math.floor(getBot().y /


32)+2).fg ~= 0 or getTile(math.floor(getBot().x / 32)-1, math.floor(getBot().y /
32)+2).bg ~= 0 do
punch(-1,2)
sleep(150)
end

while getTile(math.floor(getBot().x / 32)+2, math.floor(getBot().y /


32)+1).fg ~= 0 or getTile(math.floor(getBot().x / 32)+2, math.floor(getBot().y /
32)+1).bg ~= 0 do
punch(2,1)
sleep(150)
end

while getTile(math.floor(getBot().x / 32)+1, math.floor(getBot().y /


32)+2).fg ~= 0 or getTile(math.floor(getBot().x / 32)+1, math.floor(getBot().y /
32)+2).bg ~= 0 do
punch(1,2)
sleep(150)
end

while getTile(math.floor(getBot().x / 32)+1, math.floor(getBot().y / 32)).fg


~= entrance do
place(entrance,1,0)
sleep(150)
end

while getTile(math.floor(getBot().x / 32)-1, math.floor(getBot().y / 32)).fg


~= entrance do
place(entrance,-1,0)
sleep(150)
end

while getTile(math.floor(getBot().x / 32), math.floor(getBot().y / 32)-1).fg


~= worldLock do
place(worldLock,0,-1)
sleep(150)
end

while getTile(math.floor(getBot().x / 32)+1, math.floor(getBot().y / 32)-


1).fg ~= 2 do
place(2,1,-1)
sleep(150)
end

if useJammer == true and findItem(226) ~= 0 then


while getTile(math.floor(getBot().x / 32)-1, math.floor(getBot().y /
32)-1).fg ~= 226 do
place(226,-1,-1)
sleep(150)
end
sleep(500)
punch(-1,-1)
else
while getTile(math.floor(getBot().x / 32)-1, math.floor(getBot().y /
32)-1).fg ~= 2 do
place(2,-1,-1)
sleep(150)
end
end

sleep(500)
move(2,0)
sleep(500)

while getTile(math.floor(getBot().x / 32)-1, math.floor(getBot().y /


32)+1).fg ~= 0 or getTile(math.floor(getBot().x / 32)-1, math.floor(getBot().y /
32)+1).bg ~= 0 do
punch(-1,1)
sleep(150)
end

sleep(500)

while getTile(math.floor(getBot().x / 32)-1, math.floor(getBot().y /


32)+1).fg ~= door do
place(door,-1,1)
sleep(150)
end

wrench(-1,1)
sleep(2000)
sendPacket(2,"action|dialog_return\ndialog_name|door_edit\ntilex|"..
math.floor(getBot().x/32)-1 .."|\ntiley|".. math.floor(getBot().y/32)+1 .."|\
ndoor_name|id\ndoor_target|\ndoor_id|".. doorId .."\ncheckbox_locked|0")
sleep(1000)
move(-2,0)
sleep(1000)
wrench(0,-1)
sleep(2000)
sendPacket("action|dialog_return\ndialog_name|lock_edit\ntilex|"..
(math.floor(getBot().x/32)).."|\ntiley|"..(math.floor(getBot().y/32)-1).."|\
nbuttonClicked|recalcLock\n\ncheckbox_public|0\ncheckbox_ignore|1",2)

end

for i=1,worldCount do
repeat
generateWorld()
until checkWorld()
setupWorld()
sleep(2000)
webHook("Create World **"..getBot().world.."**", getBot().name)
end

You might also like