Luna weekly AFK [Alpha Version] (Closed).

Post Reply
User avatar
smaion40
Posts: 83
Joined: Tue Apr 25, 2017 12:11 pm
Has thanked: 42 times
Been thanked: 16 times

Luna weekly AFK [Alpha Version] (Closed).

Post by smaion40 » Sat Oct 21, 2017 11:09 pm

Hello guys. A few days ago somebody requested a script for Secret Munitions Factory instance aka Luna weekly, I'm really new into scripting, but I wanted to try some ideas. For now this is a WIP project, so selection / attack routines are not working as intented, only travel path is ok.

This script is based in a pawelgbw contribution, and some from cooco, so all the credit goes to them.

What to do:
Enter the instance and stay at spawn zone. Press Control + P to start the script.

Code: Select all

tab = {
409.04, 293.99, 199.33,
406.82, 293.19, 199.33,
404.52, 292.37, 199.33,
402.56, 291.66, 199.33,
402.43, 291.62, 199.33,
399.92, 290.72, 199.33,
397.94, 290.01, 199.33,
397.48, 289.80, 199.33,
395.54, 288.94, 199.33,
393.86, 288.19, 199.33,
392.84, 287.74, 199.33,
391.87, 287.31, 199.33,
390.13, 286.53, 199.33,
387.78, 285.67, 199.33,
386.73, 285.29, 199.33,
384.29, 284.71, 199.33,
381.49, 283.94, 199.33,
381.49, 283.94, 199.33,
379.56, 282.97, 199.33,
377.02, 281.69, 199.33,
377.02, 281.69, 199.33,
374.14, 279.98, 199.33,
372.60, 279.06, 199.33,
370.74, 277.55, 199.33,
368.78, 275.69, 199.33,
368.22, 275.13, 199.33,
365.26, 272.23, 199.33,
364.32, 271.43, 199.33,
362.54, 269.96, 199.33,
359.47, 268.24, 199.33,
359.47, 268.24, 199.33,
355.58, 266.22, 199.33,
353.94, 265.70, 199.33,
352.16, 265.29, 199.33,
348.90, 264.77, 199.33,
348.90, 264.77, 199.33,
345.08, 264.12, 199.33,
343.72, 263.87, 199.33,
340.79, 263.33, 199.33,
338.52, 262.91, 199.33,
336.96, 262.62, 199.33,
334.14, 262.10, 199.33,
332.82, 261.86, 199.33,
330.79, 261.71, 199.33,
327.66, 261.25, 199.33,
327.66, 261.25, 199.33,
324.00, 260.73, 199.33,
320.25, 260.48, 199.33,
320.22, 260.48, 199.33,
315.55, 260.15, 199.33,
314.38, 260.04, 199.33,
309.61, 259.82, 199.33,
307.76, 259.75, 199.33,
304.93, 259.63, 199.33,
302.14, 259.52, 199.33,
301.31, 259.48, 199.33,
297.74, 259.34, 199.33,
296.26, 259.28, 199.33,
294.46, 259.20, 199.33,
290.75, 259.05, 199.33,
290.75, 259.05, 199.33,
288.02, 258.94, 199.33,
284.65, 258.80, 199.33,
284.65, 258.80, 199.33,
280.98, 258.65, 199.33,
278.19, 258.53, 199.33,
277.72, 258.51, 199.33,
274.58, 258.39, 199.33,
271.71, 258.27, 199.33,
271.69, 258.27, 199.33,
268.60, 258.14, 199.33,
266.32, 258.05, 199.33,
265.52, 258.01, 199.33,
262.07, 257.87, 199.33,
260.44, 257.81, 199.33,
258.61, 257.73, 199.33,
255.36, 257.60, 199.33,
255.36, 257.60, 199.33,
251.77, 257.45, 199.33,
248.65, 257.32, 199.33,
248.43, 257.31, 199.33,
245.91, 257.21, 199.33,
243.00, 257.09, 199.33,
243.00, 257.09, 199.33,
240.73, 257.00, 199.33,
238.05, 257.10, 199.33,
237.89, 257.11, 199.33,
234.63, 257.24, 199.33,
231.96, 257.35, 199.33,
231.66, 257.36, 199.33,
227.28, 257.54, 199.33,
227.28, 257.54, 199.33,
225.56, 257.58, 199.33,
224.21, 257.61, 199.33,
220.67, 257.69, 199.33,
220.14, 257.70, 199.33,
215.82, 257.81, 199.33,
214.60, 257.83, 199.33,
212.94, 257.87, 199.33,
209.21, 257.96, 199.33,
209.21, 257.96, 199.33,
205.68, 258.04, 199.33,
203.02, 258.11, 199.33,
203.02, 258.11, 199.33,
200.47, 258.17, 199.33,
197.12, 258.24, 199.33,
197.12, 258.24, 199.33,
193.69, 258.66, 199.33,
191.15, 258.96, 199.33,
191.12, 258.96, 199.33,
189.05, 259.21, 199.33,
187.05, 259.15, 199.33,
185.87, 259.12, 199.33,
184.62, 259.08, 199.33,
182.20, 259.01, 199.33,
180.03, 258.95, 199.33,
180.03, 258.95, 199.33,
177.77, 258.88, 199.33,
174.64, 258.79, 199.33,
174.63, 258.79, 199.33,
172.36, 259.34, 199.33,
170.38, 259.82, 199.33,
168.10, 260.38, 199.33,
167.39, 260.55, 199.33,
163.21, 261.49, 199.33,
163.21, 261.49, 199.33,
160.95, 261.99, 199.33,
160.01, 263.68, 192.02, -- Experience Beads Location
157.87, 263.43, 191.98, 
153.84, 264.22, 191.87, 
152.99, 264.60, 191.97, 
151.79, 265.21, 191.87, 
150.20, 268.38, 191.87, 
149.44, 270.50, 191.87, 
149.22, 271.36, 191.87, 
148.17, 274.38, 191.87, 
145.63, 275.65, 191.87, 
145.61, 275.67, 191.87, 
143.32, 275.18, 191.87, 
140.97, 274.07, 191.87, 
140.78, 273.77, 191.87, 
139.89, 272.43, 191.87, 
138.63, 270.84, 191.87, -- Quest Box Location
- 1, - 1, - 1
}

-- Variables.

         Plr = Player:GetPosition()
   delay_SEC = 0.4
     tick_MS = 0
tab_ENDTRACE = false
   tab_COUNT = 1
   FlagPause = true

-- Killing Exp Beads Routine

progstate = 0
item, item_s = nil

itemname1 = "Mechaturerk’s Core Fragment"
itemname2 = "Mechaturerk’s Footlocker"


function OnLoad()
	Register ("PauseProgram", "P", "Control")
	Write ("Press <CTRL + P>) to start/pause program.")
	Write ("Credits to: pawelgbw and cooco")
	Player:SetNoGravity(true);
end

function OnFrame()

	if tick_MS > Time()  or FlagPause == true or tab_ENDTRACE == true then
		return
	end

	-- add + 1 do result
	if tab_COUNT == 621 + 1 or tab_COUNT == 633 + 1 or tab_COUNT == 645 + 1 or tab_COUNT == 657 + 1 or tab_COUNT == 668 + 1 or tab_COUNT == 680 + 1 or
	   tab_COUNT == 691 + 1 or tab_COUNT == 702 + 1 or tab_COUNT == 714 + 1 or tab_COUNT == 727 + 1 or tab_COUNT == 738 + 1 or tab_COUNT == 751 + 1 then
	   	result = Killing_Exp_Beads()
		if result ~= 7 then
			return
		end
		progstate = 0
	end

	ftab_ReadData (tab_COUNT)

	if Plr.X == - 1 and Plr.Y == - 1 and Plr.Z == - 1 then
		tab_ENDTRACE = true
		return
	end
	Info ()
	Player:SetPosition (Plr)
	tab_COUNT = tab_COUNT + 1
	tick_MS = Time() + delay_SEC * 1000

end

function PauseProgram ()
	if FlagPause == false then
		FlagPause = true
	else
		FlagPause = false
		tick_MS = Time() + delay_SEC * 1000
	end
end

function ftab_ReadData (idx)
	id = (idx - 1) * 3
	Plr.X = tab [id + 1]
	Plr.Y = tab [id + 2]
	Plr.Z = tab [id + 3]
end

function Info()
	Write ("ID: " ..tab_COUNT.. " MoveTo: " ..Plr.X.. ", " ..Plr.Y.. ", " ..Plr.Z)
end

function Killing_Exp_Beads()

	if progstate == 0 then
		tick_MS = Time() + 1000
		PlayerInput:Console ("/select "..itemname1)
		PlayerInput:Console ("/select "..itemname2)
		item = EntityList:GetEntity(Player: GetTargetID())
		if item ~= nil and item:GetName() == itemname1 then
			progstate = 1   
		end
		return progstate
		
	end
	
	if progstate == 1 then
		tick_MS = Time() + 500
		PlayerInput:Console("/skill Return")
		progstate = 2
		return progstate
	end

	if progstate == 2 or progstate == 3 then
		tick_MS = Time() + 500
		PlayerInput:Console("/skill Toggle Power Shard")
		progstate = progstate + 1
		return progstate
	end


	if progstate == 4 then
		tick_MS = Time() + 9000
	    PlayerInput:Console("/skill Terror's Restraint")
		item_s = EntityList: GetEntity(item: GetID())
		if item_s ~= nil and item_s:IsDead() == false then
			return progstate
		end
		progstate = 5
		return progstate
	end

	if progstate == 5 then
		tick_MS = Time() + 1000
		if  DialogList:GetDialog("loot_dialog"):IsVisible() then
			DialogList:GetDialog("loot_dialog/takeall_button"):Click()
		else
			progstate = 6
		end
	return progstate
	end

	if progstate == 6 then
		if DialogList:GetDialog("loot_dialog"):IsVisible() then
			progstate = 5
			return progstate
		end
		progstate = 7
	end

	return progstate
end

function OnClose()
	Player:SetNoGravity(false);
	Write("Script Stopped.");
end


Remember that this script is an AFK version, therefore it wont make any combat at all, It will wait for the NPCs to kill everything and then move to last boss room, kill the experience beads and loot the quest box.

To Do:

*Fix Beads and Box Quest not being selected / attacked / looted.
*Implement timer function for ~26 minutes, and after that the traveling to boss room should start.
*Add support for EU (Quest Box and Experience Beads name are needed)


I also made a second script from scratch, really basic, I'm stuck in the traveling routine. It's commentated so any ideas/suggestions are highly appreciated.

Second version

Code: Select all

--Instance Spawn coordinate
--(400.32, 290.78, 198.64)

--TNT initial timer is 2min

-- Instance ends after
-- 00:38:15
-- Total time for afk: 26 mins


--Variable initialization
function OnLoad()

TimerA = 0;
Timer =0;
arrayCount = 0;

Write("AFK time...");
Write("Time Left: 26 minutes");
end
--NA Skills
SoulScreamID = 416;       --Skill 1 single target
WaveofDarknessID = 418;   --Skill 2 AoE skill
TerrorRestraintID = 417;  --Skill 3 AoE high range
HellishFissureID = 419;   --Skill 4 Single target high dps
CloakofDarkessID = 420;   --Skill 5 Healing Buff

-- Beads name: "Mechaturerk’s Core Fragment"
-- Box quest name: "Mechaturerk’s Footlocker"

--EU Skills
--Darkness Cry
--Darkness Wave
--Horror Shackles
--Infernal Rift
--Mantle of Darkness

function OnRun()
if Time() > (TimerA + 1560000) then              --26 Mins timer to start the script
	TimerA = Time();
	Write("Time's up: Starting Script");
	
	-- Route: Spawn to beads
	Write("Moving to experience beads location.");
	coordinate = {}	
	coordinate[1]  = {400.32, 290.78, 198.64} 
	coordinate[2]  = {394.82, 288.41, 198.69}
	coordinate[3]  = {387.57, 285.87, 198.63}
	coordinate[4]  = {381.20, 283.61, 198.47} 
	coordinate[5]  = {374.74, 280.62, 198.20}
	coordinate[6]  = {369.45, 276.22, 198.13} 
	coordinate[7]  = {365.94, 272.59, 198.11} 
	coordinate[8]  = {361.53, 268.92, 197.61} 
	coordinate[9]  = {356.11, 265.92, 195.76}
	coordinate[10] = {351.17, 264.39, 194.52} 
	coordinate[11] = {345.48, 263.20, 193.54} 
	coordinate[12] = {340.58, 262.21, 193.05} 
	coordinate[13] = {334.41, 261.32, 193.00} 
	coordinate[14] = {329.28, 260.71, 192.62} 
	coordinate[15] = {323.57, 260.34, 192.32} 
	coordinate[16] = {318.28, 260.06, 191.54} 
	coordinate[17] = {313.29, 259.85, 191.02} 
	coordinate[18] = {307.88, 259.69, 191.02} 
	coordinate[19] = {302.68, 259.60, 191.02} 
	coordinate[20] = {295.79, 259.50, 191.02} 
	coordinate[21] = {289.47, 259.44, 191.02} 
	coordinate[22] = {284.15, 259.39, 191.02} 
	coordinate[23] = {277.28, 259.32, 191.02} 
	coordinate[24] = {271.54, 259.27, 191.02} 
	coordinate[25] = {265.42, 259.21, 191.02} 
	coordinate[26] = {258.40, 259.15, 191.15} 
	coordinate[27] = {251.74, 259.16, 191.02}
	coordinate[28] = {245.70, 259.20, 191.02} 
	coordinate[29] = {238.98, 259.20, 191.02} 
	coordinate[30] = {233.96, 259.20, 191.02} 
	coordinate[31] = {227.85, 259.20, 191.02} 
	coordinate[32] = {221.55, 259.23, 191.02} 
	coordinate[33] = {215.57, 259.29, 191.02} 
	coordinate[34] = {209.50, 259.48, 191.78} 
	coordinate[35] = {203.89, 259.68, 191.87} 
	coordinate[36] = {198.88, 259.86, 191.87} 
	coordinate[37] = {193.82, 260.04, 191.87} 
	coordinate[38] = {187.17, 260.28, 191.87}
	coordinate[39] = {180.51, 260.52, 191.87} 
	coordinate[40] = {175.02, 260.73, 191.99} 
	coordinate[41] = {169.49, 261.10, 191.98} 
	coordinate[42] = {163.58, 262.23, 192.08} 
	coordinate[43] = {157.87, 263.43, 191.98} 
	coordinate[44] = {157.87, 263.43, 191.98}
	Write("Experience beads reached.");
	Timer = Time() + 5000;
	
	currentPosition = Player:GetPosition(); -- retrieve the current position (x, y, z)
	-- If our distance to target coordinate is less than 1 then move to next coordinate
	if Player:GetPosition():DistanceToPosition(currentPosition) <= 1 then
		arrayCount = arrayCount + 1;
		Player:SetPosition(coordinate[arrayCount]);
	end


-- Attack Routine
-- Killing Experience Beads
-- AoE Attacks needed: 3

	for i=1, 3 
	do
    PlayerInput:Console("/select Mechaturerk’s Core Fragment")	
	PlayerInput:Ability(417) -- AoE Skill "Terror's Restraint"
	Timer = Time() + 9000;   -- 9 Seconds delay for AoE Skill
	i=i+1
	end

-- Route: Beads to box
	Write("Moving to Quest Box location.");
	coordinate = {}
	coordinate[45]  = {157.87, 263.43, 191.98} 
	coordinate[46]  = {153.84, 264.22, 191.87} 
	coordinate[47]  = {152.99, 264.60, 191.97} 
	coordinate[48]  = {151.79, 265.21, 191.87} 
	coordinate[49]  = {150.20, 268.38, 191.87} 
	coordinate[50]  = {149.44, 270.50, 191.87} 
	coordinate[51]  = {149.22, 271.36, 191.87} 
	coordinate[52]  = {148.17, 274.38, 191.87} 
	coordinate[53]  = {145.63, 275.65, 191.87} 
	coordinate[54]  = {145.61, 275.67, 191.87} 
	coordinate[55]  = {143.32, 275.18, 191.87} 
	coordinate[56]  = {140.97, 274.07, 191.87} 
	coordinate[57]  = {140.78, 273.77, 191.87} 
	coordinate[58]  = {139.89, 272.43, 191.87} 
	coordinate[59]  = {138.63, 270.84, 191.87}
	Write("Quest box reached.");
	Timer = Time() + 5000;

	currentPosition = Player:GetPosition(); -- retrieve the current position (x, y, z)
	-- If our distance to target coordinate is less than 1 then move to next coordinate
	if Player:GetPosition():DistanceToPosition(currentPosition) <= 1 then
		arrayCount = arrayCount + 1;
		Player:SetPosition(coordinate[arrayCount]);
	end	

-- Box loot routine

	for i=1, 3 
	do
	PlayerInput:Console("/select Mechaturerk’s Footlocker")
	PlayerInput:Console("/Attack")
	PlayerInput:Ability( "Loot" );
	Timer = Time() + 9000;
	i=i+1;
	end

end
 
 
end 



To Do 2:

*Fix Traveling Path
Last edited by smaion40 on Sun Oct 29, 2017 5:24 pm, edited 1 time in total.

User avatar
LordSnack
Posts: 96
Joined: Tue Jun 13, 2017 10:44 pm
Has thanked: 26 times
Been thanked: 10 times

Re: Luna weekly: Secret Munitions Factory script. [Alpha Version]

Post by LordSnack » Mon Oct 23, 2017 7:10 pm

This is the EU Names for this:

--Skills:
Darkness Cry (2.500 Dmg on an enemy)
Darkness Wave (4.000 Dmg on 5 enemies)
Horror Shackles (8.000 Dmg 8 Enemies around caster)
Infernal Rift (Big Hit 90k Dmg on an enemy + Stun)
Mantle of Darkness (20k Heal und Hide for 5 seconds)

First Boss: ???
Last Boss: Mechanerk

Experience + Chests:
EXP: Mechanerk's Core
Chests: Left > Right
Machine Soldier's Chest
Maintenance Soldier's Chest
Cannoneer's Chest
Remirinerk's Chest
Bomirinerk's Chest
Creature's Chest
Mechanerk's Chest
Mechanerk's Gold Chest

Teleport Gate after Gate kill: Dimension Gate of the Weapons Factory
Last Gate: Atreia Corridor
EU Thor - Gameforge | NA - Danaria

User avatar
smaion40
Posts: 83
Joined: Tue Apr 25, 2017 12:11 pm
Has thanked: 42 times
Been thanked: 16 times

Re: Luna weekly AFK [Alpha Version] (Closed).

Post by smaion40 » Sun Oct 29, 2017 5:24 pm

Hello guys, I'm making a new version that supports combat and Rank A. AFK is not needed anymore.

viewtopic.php?f=8&t=302

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest