Help me on how to make dragon corpse not disappear after looting

The role-playing games (I-X) that started it all and the various spin-offs (including Dark Messiah).
EQmonk
Leprechaun
Leprechaun
Posts: 7
Joined: 02 May 2019

Help me on how to make dragon corpse not disappear after looting

Unread postby EQmonk » 02 May 2019, 21:39

I'm really got bored S/L to get my dragon loot (I'm playing the great MM678 Merged mod)

So can anyone tell me how can i tweak that please? Been search for days, and I see there is event.PickCorpse in event.Lua under scripts folder, yet can't get any further. Thanks in advance!

EQmonk
Leprechaun
Leprechaun
Posts: 7
Joined: 02 May 2019

Re: Help me on how to make dragon corpse not disappear after looting

Unread postby EQmonk » 07 May 2019, 00:23

Plz, anyone ? Thanks so much

Lucius
Leprechaun
Leprechaun
Posts: 33
Joined: 01 Dec 2017

Re: Help me on how to make dragon corpse not disappear after looting

Unread postby Lucius » 08 May 2019, 08:28

You can do it in different way by writing external script which will click on dragon and reload a game if corpse disappeared. You can make it complex enough to read loot message to discard categories of items you don't need. I used python for this.

EQmonk
Leprechaun
Leprechaun
Posts: 7
Joined: 02 May 2019

Re: Help me on how to make dragon corpse not disappear after looting

Unread postby EQmonk » 08 May 2019, 20:53

Thank you very much sir! Is it possible to share the python code please? (If no totally understand)

Lucius
Leprechaun
Leprechaun
Posts: 33
Joined: 01 Dec 2017

Re: Help me on how to make dragon corpse not disappear after looting

Unread postby Lucius » 08 May 2019, 22:35

I don't have it near me now, I can share with you if I'll have time write a new one. But you will have to adjuct it ti your system (window coordinates and image hashes)

Lucius
Leprechaun
Leprechaun
Posts: 33
Joined: 01 Dec 2017

Re: Help me on how to make dragon corpse not disappear after looting

Unread postby Lucius » 10 May 2019, 07:14

Unfortunately python doesn't work for me on Windows 10. So I've made simple Autohotkey script.
Get Autohotkey at https://www.autohotkey.com/

Code: Select all

LoadGame()
{
	send {F8}
	PixelGetColor, checkcolor, 447, 56
	while checkcolor != 0x6B7963
	{
		Sleep 100
		PixelGetColor, checkcolor, 447, 56
	}
	return
}

SaveGame()
{
Sleep 100
send {F5}
Sleep 100
return
}

DoLoot()
{
send {Space}
Sleep 100
}

#j::
WinActivate, Might and Magic
CoordMode, Pixel, Window 
CoordMode, Mouse, Window 

MouseGetPos, LootXPosition, LootYPosition 
MaxLootItems = 10
PixelGetColor, color, %LootXPosition%, %LootYPosition%
;MsgBox The color at the %LootXPosition%, %LootYPosition% is %color%.

while MaxLootItems > 0
	{
	DoLoot()
	Sleep 100
	PixelGetColor, newcolor, %LootXPosition%, %LootYPosition%
	if (newcolor == color)
		{
			MaxLootItems := MaxLootItems - 1
			SaveGame()
		}
	else
		{
			LoadGame()
		}
	}
Send {Enter}
return
MaxLootItems = 10 is how many items you want to dig up before stop.
Start script by hovering mouse cursor over dragon (to let script know to find it it disappeared) and press win+J (its #j:: in script code). I suggest to read Autohotkey documentation tutorial.
Make sure that

Code: Select all

PixelGetColor, checkcolor, 447, 56
	while checkcolor != 0x6B7963
is same for your game window and adjuct if is not. This is check if the game is loaded by reading pixel of game interface. If it does not work for you,
check it for your layout by
MsgBox The color at the %LootXPosition%, %LootYPosition% is %color%.
(read the documentation to understand how the script works)
This assumes that your keys for save/load are F5,F8, adjuct it in mm8.ini
Last edited by Lucius on 10 May 2019, 07:15, edited 1 time in total.

EQmonk
Leprechaun
Leprechaun
Posts: 7
Joined: 02 May 2019

Re: Help me on how to make dragon corpse not disappear after looting

Unread postby EQmonk » 10 May 2019, 18:00

Thank you so much, can't wait to run it! /bow

EQmonk
Leprechaun
Leprechaun
Posts: 7
Joined: 02 May 2019

Re: Help me on how to make dragon corpse not disappear after looting

Unread postby EQmonk » 11 May 2019, 01:41

works like a charm, thanks a lot!


Return to “Might and Magic”

Who is online

Users browsing this forum: Google [Bot] and 34 guests