micromacro properties

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
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.
Post Reply
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

micromacro properties

#1 Post by rock5 » Fri Jan 18, 2013 11:57 pm

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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: micromacro properties

#2 Post by lisa » Sat Jan 19, 2013 12:21 am

if you know the process for the specific MM you can use

Code: Select all

local windowList = findWindowList("MicroMacro");
local wx, wy, ww, wh = windowRect(windowList [1]);
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

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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: micromacro properties

#3 Post by lisa » Sat Jan 19, 2013 12:52 am

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

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
hmm mind you the getHwnd() might be all you need to find the MM window process
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: micromacro properties

#4 Post by rock5 » Sat Jan 19, 2013 1:05 am

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.

Code: Select all

local window = findWindow("MicroMacro");
local wx, wy, ww, wh = windowRect(window);
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.
logo.jpg
Is it possible to change the character so it's a full half block? I suspect not but it doesn't hurt to ask.
  • 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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: micromacro properties

#5 Post by lisa » Sat Jan 19, 2013 1:06 am

yup

Code: Select all

local wx, wy, ww, wh = windowRect(getHwnd())
printf("Current MM Height is :%d , Width is :%d\n",ww,wh)
prints this

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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: micromacro properties

#6 Post by lisa » Sat Jan 19, 2013 1:09 am

rock5 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.
divide by 8

Code: Select all

local wx, wy, ww, wh = windowRect(getHwnd())
numcharacters = ww/8
it is on my screen anyway ;)
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: micromacro properties

#7 Post by rock5 » Sat Jan 19, 2013 1:15 am

lisa wrote:divide by 8

it is on my screen anyway ;)
I thought about that but the fonts width can be changed.
  • 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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: micromacro properties

#8 Post by lisa » Sat Jan 19, 2013 1:29 am

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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: micromacro properties

#9 Post by rock5 » Sat Jan 19, 2013 1:38 am

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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: micromacro properties

#10 Post by lisa » Sat Jan 19, 2013 5:04 am

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

Code: Select all

setWindowName(getWin(), player.Name)
Could also set it for the WP file name or even account 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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: micromacro properties

#11 Post by rock5 » Sat Jan 19, 2013 5:48 am

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

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: micromacro properties

#12 Post by Administrator » Sat Jan 19, 2013 12:43 pm

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.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: micromacro properties

#13 Post by rock5 » Sat Jan 19, 2013 12:58 pm

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.
Cool, thanks.
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.
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.

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))
They print right when using the Raster fonts but not when using the other 2.
  • 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

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: micromacro properties

#14 Post by Administrator » Sat Jan 19, 2013 1:07 pm

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 mean

Code: Select all

print(string.char(0xDF,0xDC))
They print right when using the Raster fonts but not when using the other 2.
I don't know about that. I think there will be a lot of issues with different fonts. Have you tried 0xFE?
Maybe the extended ASCII table will help: http://www.asciitable.com/

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: micromacro properties

#15 Post by rock5 » Sat Jan 19, 2013 1:43 pm

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.
Attachments
blocks.jpg
  • 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

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: micromacro properties

#16 Post by Administrator » Sat Jan 19, 2013 3:46 pm

That's really strange. I have no idea why that would be. The text color shouldn't affect that.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: micromacro properties

#17 Post by lisa » Sun Jan 20, 2013 11:24 am

rock5 wrote:
lisa wrote:divide by 8

it is on my screen anyway ;)
I thought about that but the fonts width can be changed.

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
math.fmod returns the remainder of the division of the 2 numbers, so if there is no remainder (0) then pretty good chance the font size is the value of i.
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: micromacro properties

#18 Post by rock5 » Sun Jan 20, 2013 11:38 am

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.
  • 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

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests