Wizardry Online - Auto-reroll

For any other game that doesn't have its own section.
Post Reply
Message
Author
User avatar
Administrator
Site Admin
Posts: 5313
Joined: Sat Jan 05, 2008 4:21 pm

Wizardry Online - Auto-reroll

#1 Post by Administrator » Wed Oct 30, 2013 2:25 am

Requires MicroMacro 1.03

What's this do?
When creating a new character in Wizardry, you get to roll on bonus points. It is a random number of extra stat points you get to allocate. More points means a stronger character.

Wizardry has an odd system for this. Rolls of 1-10 are fairly common, while higher rolls become very rare very quickly. Strangely enough, you can roll up to 70 bonus points! If I remember correctly, rolling a 12 is a 1% chance and 13 drops to 0.04% chance.

This script will continue rerolling on the character you want to create to get a higher bonus point score. It will stop on any number that is 20 or above. You can expect this to take roughly 12 hours for a good roll, so you must be patient. Be aware that you can only put a max of 10 points into any specific attribute so you'll have to spread some points around.


So how do I use it?
Download the script and pop it into your micromacro/scripts directory. Now edit it with Notepad or whatever other text editor you want to use. Near the top, you'll see these lines:

Code: Select all

--[[
	Character will be all lowercase and follow the format 'race_sex'
	where race is 'human', 'dwarf', 'gnome', 'elf', or 'porkul' and sex
	will be either 'm' or 'f'.

	Resolution will follow the format widthxheight
]]
local character = 'human_m';
local resolution = '1024x768';
Change human_m to whichever race/sex you want to use. Change resolution to the resolution you are using (note: currently only 1024x768 and 1440x900 are available). Save the script. Now start the game (if you haven't already) and get to the new character creation screen (the one with all the buttons to select race/sex). Start MicroMacro and run the script: reroll.lua

Now switch back to the game and press F5 to start rolling. You should see the mouse jumping around and clicking buttons. It's working!

When a high roll is detected, you'll hear a system beep and the script will automatically stop. If you're not happy with the roll (greedy? 20 not high enough for you?) then you can switch back to MicroMacro, press the UP arrow key (or just type reroll.lua again), and start the script all over.


My resolution isn't supported!
That sucks. Guess you're screwed!

Or maybe not. You can manually find all the information you'll need to configure your resolution within ~10 minutes. First, get to the character creation screen and take a screenshot (Print Screen button on your keyboard). Go to MS Paint (or any image editor) and paste the screenshot. Zoom in to each of the key points and write down the X and Y coordinates. The 'key points' you'll need are the OK, OK2 (on the bonus point roll window), Cancel, each race/sex button, and the scanx/y pairs (see below for more information).

For the buttons, try to choose a point that is roughly in the certain of the button; it doesn't need to be exact. For the scanx/y pairs, you'll want to manually roll a few times and try to get a score of 10. Once you do that, screenshot again and print it over to MS Paint.

Refer to the below graphic for an illustration of what you're looking for.
points.png
To the left of the '1' in '10', you'll see that I drew a red box. The top-left point represents scanx1 and scany1. How far left you go doesn't matter much; it doesn't need to be exact. Just make sure that you don't go too high on the Y value so that the box would overlap part of the '1'. Do the same for the bottom right corner but be careful to give it a 1 pixel border between touching the '1'.

Around line 15 of the script, you'll see the table that contains all the point data that is needed for each resolution. Just copy the ['1024x768'] section, paste it, rename it, and plug in your own data with the information you wrote down before. You're set to now use this new resolution.

Please share your findings here and I'll add it to the script for everyone else to use.


Technical stuff to mention
These are just a few notes for those of you who actively work on scripts and are curious as to why I made the decisions that I did and coded things the way they are.
  • Slow pixel searching needs to be done; unfortunately, something with the game doesn't allow MicroMacro to grab a full copy of its buffer which would allow for near instantaneous screen examination. Because of this, it may take a second or two to recognize that your roll was unsuccessful before it clicks the "OK" button.
  • It is resolution dependent because it functions by reading the screen to detect white pixels in the numbers. Memory reading would be much quicker and more configurable, but also carries a better chance of getting you banned. I decided not to go this route.
  • mouseMove(1, 1) is used AFTER mouseSet() because the game detects mouse mickeys (movement in pixels) rather than polling the raw position. Moving the mouse like this causes the game to update the mouse position where we want it.
Attachments
reroll.lua
(3.96 KiB) Downloaded 433 times

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests