Game script

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
thegamer
Newbie
Posts: 1
Joined: Tue Mar 25, 2008 11:36 pm

Game script

Post by thegamer » Wed Mar 26, 2008 9:28 am

Hello people

I am playing a text-based MMORPG game on the website http://www.themafianetwork.net and on that game in order to rank up you have to do crimes, gta and jail breaking all the time.
Well i thought maybe you guys could help me to make a script for it.

I used other programs for script before and it was going well because of its easy to use but i quit that program (because of the image problem i explain later) and now i am using Macro scheduler, but it is hard to do it for me.
I need a script that does crimes every 2minutes, gta every 3 minutes and meanwhile it has to break out of jail continuously.

To do these actions you just have to click a specific place. But there is one problem: sometimes when i want to do crimes or gta 9 images appears. only 1 of them have another color than the rest. It has to click to the different one. When breaking out of jail you dont get images. Just clicking is enough.
I made a screenshot so you can see it:
Image

I made a test account so maybe you guys could help me with this problem.

username: klmpeople
password : >0Mu&K%48_

thank you

durexlw
Newbie
Posts: 18
Joined: Mon Mar 17, 2008 1:19 pm

Post by durexlw » Fri Mar 28, 2008 1:13 pm

iBLeftX and iBLeftY are the bottomleft x and y coordinate of the first image, the rest should be the same on your screen I guess, if not change the values.

iDistance: x and y distances between two images
iImage: width, height of images to capture (you just want the part below the numbers)

The script takes the bottom part of each image, then compares these images to one-other. If it twice fails, that's the right image.
I didn't think too much about the algo, you can probably optimize it, anyway, it works and it should give you some inspiration:

Code: Select all

Let>iBLeftX=592
Let>iBLeftY=365
Let>iDistanceX=100
Let>iDistanceY=102
Let>iImageX=47
Let>iImageY=14
Let>nImage=0
Let>nCount=0

ScreenCapture>iBLeftX,{%iBLeftY%-%iImageY%},{%iBLeftX%+%iImageX%},iBLeftY,c:\Temp\bmp1.bmp
ScreenCapture>{%iBLeftX%+%iDistanceX%},{%iBLeftY%-%iImageY%},{%iBLeftX%+%iDistanceX%+%iImageX%},iBLeftY,c:\Temp\bmp2.bmp
ScreenCapture>{%iBLeftX%+(2*%iDistanceX%)},{%iBLeftY%-%iImageY%},{%iBLeftX%+(2*%iDistanceX%)+%iImageX%},iBLeftY,c:\Temp\bmp3.bmp
ScreenCapture>iBLeftX,{%iBLeftY%-%iImageY%+%iDistanceY%},{%iBLeftX%+%iImageX%},{%iBLeftY%+%iDistanceY%},c:\Temp\bmp4.bmp
ScreenCapture>{%iBLeftX%+%iDistanceX%},{%iBLeftY%-%iImageY%+%iDistanceY%},{%iBLeftX%+%iDistanceX%+%iImageX%},{%iBLeftY%+%iDistanceY%},c:\Temp\bmp5.bmp
ScreenCapture>{%iBLeftX%+(2*%iDistanceX%)},{%iBLeftY%-%iImageY%+%iDistanceY%},{%iBLeftX%+(2*%iDistanceX%)+%iImageX%},{%iBLeftY%+%iDistanceY%},c:\Temp\bmp6.bmp
ScreenCapture>iBLeftX,{%iBLeftY%-%iImageY%+(2*%iDistanceY%)},{%iBLeftX%+%iImageX%},{%iBLeftY%+(2*%iDistanceY%)},c:\Temp\bmp7.bmp
ScreenCapture>{%iBLeftX%+%iDistanceX%},{%iBLeftY%-%iImageY%+(2*%iDistanceY%)},{%iBLeftX%+%iDistanceX%+%iImageX%},{%iBLeftY%+(2*%iDistanceY%)},c:\Temp\bmp8.bmp
ScreenCapture>{%iBLeftX%+(2*%iDistanceX%)},{%iBLeftY%-%iImageY%+(2*%iDistanceY%)},{%iBLeftX%+(2*%iDistanceX%)+%iImageX%},{%iBLeftY%+(2*%iDistanceY%)},c:\Temp\bmp9.bmp

CompareBitmaps>C:\temp\bmp1.bmp,C:\temp\bmp2.bmp,nMatch
If>nMatch<90
	CompareBitmaps>C:\temp\bmp1.bmp,C:\temp\bmp4.bmp,nMatch
	if>nMatch<90
		Message>It's Number 1!
	endif
Endif

CompareBitmaps>C:\temp\bmp2.bmp,C:\temp\bmp3.bmp,nMatch
If>nMatch<90
	CompareBitmaps>C:\temp\bmp2.bmp,C:\temp\bmp5.bmp,nMatch
	if>nMatch<90
		Message>It's Number 2!
	endif
Endif

CompareBitmaps>C:\temp\bmp3.bmp,C:\temp\bmp4.bmp,nMatch
If>nMatch<90
	CompareBitmaps>C:\temp\bmp3.bmp,C:\temp\bmp6.bmp,nMatch
	if>nMatch<90
		Message>It's Number 3!
	endif
Endif

CompareBitmaps>C:\temp\bmp4.bmp,C:\temp\bmp5.bmp,nMatch
If>nMatch<90
	CompareBitmaps>C:\temp\bmp4.bmp,C:\temp\bmp7.bmp,nMatch
	if>nMatch<90
		Message>It's Number 4!
	endif
Endif

CompareBitmaps>C:\temp\bmp5.bmp,C:\temp\bmp6.bmp,nMatch
If>nMatch<90
	CompareBitmaps>C:\temp\bmp5.bmp,C:\temp\bmp8.bmp,nMatch
	if>nMatch<90
		Message>It's Number 5!
	endif
Endif

CompareBitmaps>C:\temp\bmp6.bmp,C:\temp\bmp7.bmp,nMatch
If>nMatch<90
	CompareBitmaps>C:\temp\bmp6.bmp,C:\temp\bmp9.bmp,nMatch
	if>nMatch<90
		Message>It's Number 6!
	endif
Endif

CompareBitmaps>C:\temp\bmp7.bmp,C:\temp\bmp8.bmp,nMatch
If>nMatch<90
	CompareBitmaps>C:\temp\bmp7.bmp,C:\temp\bmp1.bmp,nMatch
	if>nMatch<90
		Message>It's Number 7!
	endif
Endif

CompareBitmaps>C:\temp\bmp8.bmp,C:\temp\bmp9.bmp,nMatch
If>nMatch<90
	CompareBitmaps>C:\temp\bmp8.bmp,C:\temp\bmp2.bmp,nMatch
	if>nMatch<90
		Message>It's Number 8!
	endif
Endif

CompareBitmaps>C:\temp\bmp9.bmp,C:\temp\bmp1.bmp,nMatch
If>nMatch<90
	CompareBitmaps>C:\temp\bmp9.bmp,C:\temp\bmp3.bmp,nMatch
	if>nMatch<90
		Message>It's Number 9!
	endif
Endif
Last edited by durexlw on Fri Mar 28, 2008 1:44 pm, edited 2 times in total.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Mar 28, 2008 1:40 pm

1. Bad language is not tolerated on this forum. I've edited durexlw's response. Frequent offenders will be banned.

2. When pasting code into the forum use the Code button. It *should* prevent smilies and avoid confusing some of the code for HTML, but if not check the "Disable HTML in this post" and "Disable Smilies in this post" boxes when posting. That always works for me.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts