micromacro properties
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
micromacro properties
Is there any way I can get the dimensions of the MM window via the commandline? Is there any command for this?
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: micromacro properties
if you know the process for the specific MM you can use
you get the idea anyway, not sure if there is a specific function just for getting the current MM window.
If there was one it would be in /src/luaglue.cpp
--=== Added ===--
you can also use this aswell
Code: Select all
local windowList = findWindowList("MicroMacro");
local wx, wy, ww, wh = windowRect(windowList [1]);
If there was one it would be in /src/luaglue.cpp
--=== Added ===--
you can also use this aswell
Code: Select all
findWindowList("*","ConsoleWindowClass")
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: micromacro properties
might seem a little crude but you could do this.
Change window name on the MM using setWindowName and then check for that window name using
hmm mind you the getHwnd() might be all you need to find the MM window process
Change window name on the MM using setWindowName and then check for that window name using
Code: Select all
setWindowName(getHwnd(), "name you set")
local mmwindow = findWindowList("*","ConsoleWindowClass")
for i = 1,#findWindowList do
if getWindowName(windowList[i]) == "name you set" then
mymm = mmwindow[i]
return
end
end
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: micromacro properties
I suspect your example returns the window dimensions. I didn't make myself clear. I was after the character dimensions. For a laugh I'm trying to make a better image displayer and wanted to know if the image would fit.
BTW, if you don't need the window list then you can just use "findWindow()". Simplifies it a bit.
Now I have another problem. The character I was going to use, a half block, has a line down the side which ruins the result.
Is it possible to change the character so it's a full half block? I suspect not but it doesn't hurt to ask.
BTW, if you don't need the window list then you can just use "findWindow()". Simplifies it a bit.
Code: Select all
local window = findWindow("MicroMacro");
local wx, wy, ww, wh = windowRect(window);
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: micromacro properties
yup
prints this
Code: Select all
local wx, wy, ww, wh = windowRect(getHwnd())
printf("Current MM Height is :%d , Width is :%d\n",ww,wh)
Code: Select all
Current MM Height is :640 , Width is :540
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: micromacro properties
divide by 8rock5 wrote:I suspect your example returns the window dimensions. I didn't make myself clear. I was after the character dimensions. For a laugh I'm trying to make a better image displayer and wanted to know if the image would fit.
Code: Select all
local wx, wy, ww, wh = windowRect(getHwnd())
numcharacters = ww/8
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: micromacro properties
I thought about that but the fonts width can be changed.lisa wrote:divide by 8
it is on my screen anyway
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: micromacro properties
i used CE on the MM window and couldn't even find an address for font width, ohh well.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: micromacro properties
LoL. Me too.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: micromacro properties
this might be off topic but it got me thinking why don't we change the name of the RoM window, for example to character name, would make it easier to know which window is doing what.
It is as simple as this
Could also set it for the WP file name or even account name.
It is as simple as this
Code: Select all
setWindowName(getWin(), player.Name)
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: micromacro properties
Already done in RC3.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: micromacro properties
I've added a function to return a bunch of information about the console: window width/height (in characters), buffer width/height (in characters), and cursor X/Y. That should probably do.
Also, it's easier/more reliable to just use getHwnd() instead of querying the window name/class for a handle to the window.
Also, it's easier/more reliable to just use getHwnd() instead of querying the window name/class for a handle to the window.
Re: micromacro properties
Cool, thanks.Administrator wrote:I've added a function to return a bunch of information about the console: window width/height (in characters), buffer width/height (in characters), and cursor X/Y. That should probably do.
I knew there was a function like that because I noticed it in passing once. But for some reason I couldn't find it before. Now I found it.Administrator wrote:Also, it's easier/more reliable to just use getHwnd() instead of querying the window name/class for a handle to the window.
How about the fonts? Is it possible to make the half blocks go all the way from left to right? By half blocks I mean
Code: Select all
print(string.char(0xDF,0xDC))
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: micromacro properties
I don't know about that. I think there will be a lot of issues with different fonts. Have you tried 0xFE?rock5 wrote: How about the fonts? Is it possible to make the half blocks go all the way from left to right? By half blocks I meanThey print right when using the Raster fonts but not when using the other 2.Code: Select all
print(string.char(0xDF,0xDC))
Maybe the extended ASCII table will help: http://www.asciitable.com/
Re: micromacro properties
Aren't 0xDF and 0xDC part of the extended character set? 0xFE is a block in the middle. I can't use that.
I even checked those 2 with the Character Map utility using the 'Terminal' font, which seems to match the MM character set. It prints them with no lines between them.
Hold on a sec. Print doesn't cause lines between them, neither does printf. Only cprintf causes lines between them. Or maybe it depends on the color. It seems that only in lightgray does it print properly.
I even checked those 2 with the Character Map utility using the 'Terminal' font, which seems to match the MM character set. It prints them with no lines between them.
Hold on a sec. Print doesn't cause lines between them, neither does printf. Only cprintf causes lines between them. Or maybe it depends on the color. It seems that only in lightgray does it print properly.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: micromacro properties
That's really strange. I have no idea why that would be. The text color shouldn't affect that.
Re: micromacro properties
rock5 wrote:I thought about that but the fonts width can be changed.lisa wrote:divide by 8
it is on my screen anyway
Code: Select all
local wx, wy, ww, wh = windowRect(getHwnd())
for i = 7,12 do
if math.fmod(ww,i) == 0 then
numchars = ww/i
return
end
end
Of course this could be wrong if the width is a multiple of 2 of the numbers, 7 & 8. so 56,112,168,224,280...
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: micromacro properties
Interesting idea but of course there are a lot of other widths and therefore lots of overlaps.
Anyway Administrator said he added a function for getting info so I would eventually be able to use that but I've abandoned this project because I can't get those blocks to print properly.
Anyway Administrator said he added a function for getting info so I would eventually be able to use that but I've abandoned this project because I can't get those blocks to print properly.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Who is online
Users browsing this forum: No registered users and 19 guests