Tutorial Gloomingdeep macro

LamahHerder

Member
Joined
Dec 24, 2009
Messages
114
Reaction score
0
Points
16
Age
44
Starting to play again and wanted to make something so I could remember how to use macros

Would really appreciate if anyone could give me any pointers or suggestions

Whats good?
Whats bad?
Whats an improved way to do something?


Code:
|
| gloomingdeep.mac
|
| Goal = Run a new toon thru The Mines of Gloomingdeep Tutorial
|
| 1609a
| -First version 2016 September (by m0nk)
| -Complete all of tutoriala (by m0nk)
| -Complete tutorialb first task with Arias to get charm (by m0nk)
|
| 1609b
| -??
|

Sub Main
	 /if (${Zone.ShortName.Equal[tutoriala]}) /call doTutA
	 /if (${Zone.ShortName.Equal[tutorialb]}) /call doTutB
	 /echo You are not in the Tutorial
/end

Sub abusePerson(Person) 
	/echo Dealing with ${Person}
	/moveto id ${Spawn[npc ${Person}].ID}
	/target npc ${Spawn[npc ${Person}].DisplayName}
	/call closeWindows
	/delay 10s (${Spawn[${Person}].Distance}<14)
	/keypress h
	/call closeWindows
/return

Sub closeWindows 
	:closeWindowsLoop
		/if (${Window[inventorywindow]}) /notify inventorywindow IW_DoneButton leftmouseup
		/if (${Window[bigbankwnd]}) /notify bigbankwnd BIGB_DoneButton leftmouseup
		/if (${Window[LargeDialogWindow]}) /notify LargeDialogWindow LDW_OkButton leftmouseup
		/if (${Window[TaskSelectWnd]}) /notify TaskSelectWnd TSEL_AcceptButton leftmouseup
		/delay 1s
		/if (${Window[LargeDialogWindow]} || ${Window[TaskSelectWnd]}) /goto :closeWindowsLoop
/return

Sub doTutA
| LargeDialogWindow never goes away so cant call closeWindows =(
	/echo doTutA
	/if (${Window[LargeDialogWindow]}) /notify LargeDialogWindow LDW_OkButton leftmouseup
	/delay 1s (${Window[LargeDialogWindow]})
	/if (${Window[LargeDialogWindow]}) /notify LargeDialogWindow LDW_OkButton leftmouseup
	/delay 1s (${Window[LargeDialogWindow]})
	/if (${Window[LargeDialogWindow]}) /notify LargeDialogWindow LDW_OkButton leftmouseup
	/delay 1s (${Window[LargeDialogWindow]})

	/echo Leaving Jail!
		/say Hail, Arias
		/if (${Window[LargeDialogWindow]}) /notify LargeDialogWindow LDW_OkButton leftmouseup
		/delay 1s
		/say escape
		/delay 3s ${Window[TaskSelectWnd]}
		/if (${Window[TaskSelectWnd]}) /notify TaskSelectWnd TSEL_AcceptButton leftmouseup
		/if (${Window[LargeDialogWindow]}) /notify LargeDialogWindow LDW_OkButton leftmouseup
		/delay 1s
		/if (${Window[LargeDialogWindow]}) /notify LargeDialogWindow LDW_OkButton leftmouseup
		/if (${Window[LargeDialogWindow]}) /notify LargeDialogWindow LDW_OkButton leftmouseup
		/moveto loc 0.44 20.75
		/if (${Window[LargeDialogWindow]}) /notify LargeDialogWindow LDW_OkButton leftmouseup
		/delay 10s ${MoveTo.Stopped}

	/echo Killing Jailor
	 	/moveto loc ${Spawn[npc Jailor].Loc}
	 	/target npc Jailor
	 	/delay 10s ${MoveTo.Stopped}
	 	/killthis

	:loopKillJailer
		/delay 1s
		/if (${Me.Combat}) /goto :loopKillJailer

	/echo Loot Jailer
		/delay 2s (${Window[advancedlootwnd]})
		/if (${Window[advancedlootwnd]}) /notify advancedlootwnd ADLW_PLL_LootAllBtn leftmouseup
		/delay 2s (!${Window[advancedlootwnd]})

	/echo Give key to Arias(pet)
		/target pet Arias
		/itemnotify "The Gloomingdeep Jailor's Key" leftmouseup
		/delay 2s ${Cursor.ID}
		/if (${Window[LargeDialogWindow]}) /notify LargeDialogWindow LDW_OkButton leftmouseup
		/if (${Target.Distance} > 20) /moveto id ${Target.ID}
		/delay 2s ${MoveTo.Stopped}
		/if (${Cursor.ID}) /click left target
		/delay 2s (${Window[givewnd]})
		/if (${Window[givewnd]}) /notify givewnd GVW_Give_Button leftmouseup
		/delay 2s (!${Window[givewnd]})
		/echo Finished ${Zone.ShortName}
		/call closeWindows

	:loopLoadingZone
		/delay 10s (${Zone.ShortName.Equal[tutorialb]})
  		/target myself
  		/if (${Me.ID}!=${Target.ID}) /goto :loopLoadingZone
/return

Sub doTutB 
	/call abusePerson Arias

	/call abusePerson Vahlara
		/if (${Cursor.ID}) /autoinventory
		/call closeWindows
		/say others
		/call closeWindows

	/call abusePerson "Basher Alga"
		/keypress h
		/call closeWindows

	/echo getSword
		/delay 15s ${MoveTo.Stopped}
		/if (${GroundItemCount[Defiance]} > 0) {
			/moveto loc ${Ground[Defiance].Y} ${Ground[Defiance].X}
			/delay 15s (${Ground[Defiance].Distance3D} < 20)
			/echo Grab ${Ground[Defiance].Grab}
			} else {
			/echo Couldnt find ground item}
			/end
			}

	/call abusePerson Poxan
		/if (${Cursor.ID}) /click left target
		/delay 2s (${Window[givewnd]})
		/if (${Window[givewnd]}) /notify givewnd GVW_Give_Button leftmouseup
		/call closeWindows
		/if (${Cursor.ID}) /autoinventory

	/echo getShroom
		/moveto loc -183.26 -69.78
		/delay 15s ${MoveTo.Stopped}
		/if (${GroundItemCount[*Blue Mushroom]} > 0) {
			/moveto loc ${Ground[*Blue Mushroom].Y} ${Ground[*Blue Mushroom].X}
			/delay 15s (${Ground[*Blue Mushroom].Distance3D} < 20)
			/echo Grab ${Ground[*Blue Mushroom].Grab}
			} else {
			/echo Couldnt find ground item}
			/end
			}
		/delay 1s
		/if (${Cursor.ID}) /autoinventory

	/call abusePerson Lyndroh
		/if (${Cursor.ID}) /click right target
		/delay 2s (${Window[bigbankwnd]})
		/itemnotify bank1 leftmouseup
		/delay 2s ${Cursor.ID}
		/if (${Cursor.ID}) /autoinventory

	/call abusePerson Rytan
		/say blessed
		/call closeWindows
		/delay 1s (${Cursor.ID})
		/if (${Cursor.ID}) /autoinventory
		/delay 1s (!${Cursor.ID})
		/call closeWindows
		/if (${FindItem[Tome].InvSlot}) /itemnotify ${FindItem[Tome].InvSlot} rightmouseup
		/if (${FindItem[Spell].InvSlot}) /itemnotify ${FindItem[Spell].InvSlot} rightmouseup
		/if (${FindItem[Song].InvSlot}) /itemnotify ${FindItem[Song].InvSlot} rightmouseup
		/delay 8s (${Window[castspellwnd]})
		/call closeWindows

	/call abusePerson Xenaida
		/itemnotify ${FindItem[Mushroom].InvSlot} leftmouseup
		/delay 2s (${Cursor.ID})
		/if (${Cursor.ID}) /click left target
		/delay 2s (!${Cursor.ID})
		/if (${Window[givewnd]}) /notify givewnd GVW_Give_Button leftmouseup
		/delay 2s (!${Window[givewnd]})

	/call abusePerson Absor
		/itemnotify mainhand leftmouseup
		/if (${Cursor.ID}) /click left target
		/delay 2s (${Window[givewnd]})
		/if (${Window[givewnd]}) /notify givewnd GVW_Give_Button leftmouseup
		/delay 2s (!${Window[givewnd]})
		/call closeWindows
		/if (${FindItem[Sharpened].InvSlot}) /itemnotify ${FindItem[Sharpened].InvSlot} leftmouseup
		/if (${FindItem[Polished].InvSlot}) /itemnotify ${FindItem[Polished].InvSlot} leftmouseup
		/delay 2s (${Cursor.ID})
		/if (${Cursor.ID}) /autoinventory

	/call abusePerson Prathun
	 	/call closeWindows

	/call abusePerson Arias
		/keypress h
		/call closeWindows
		/delay 2s (!${Curser.ID})
		/if (${Cursor.ID}) /autoinventory
/echo Finished ${Zone.ShortName} first task
/end