Change exp Per Hour in Window title
Change exp Per Hour in Window title
Can I add something to my waypoints to make Rom bot show in the window title what Ive gathered so far vs how much exp Ive earner
Idealy I would have it say
RoM Bot Player****(Gathered #Number Gathered# "Item monitored")
Item monitored could be staticaly assigned so only 1 number would change
Currently it says something like
RoM Bot Player**** (exp ####/HR)
Not at home rite now but I think Thats about right.
This could be used to monitor items gathered using Harvest waypoints, Gold for Clops KS, and Eggs too. Im sure their are other uses.
Please let me know if this is already available otherwise if it can be made
Yoder
Idealy I would have it say
RoM Bot Player****(Gathered #Number Gathered# "Item monitored")
Item monitored could be staticaly assigned so only 1 number would change
Currently it says something like
RoM Bot Player**** (exp ####/HR)
Not at home rite now but I think Thats about right.
This could be used to monitor items gathered using Harvest waypoints, Gold for Clops KS, and Eggs too. Im sure their are other uses.
Please let me know if this is already available otherwise if it can be made
Yoder
Re: Change exp Per Hour in Window title
Check this thread started by Lisa:
http://www.solarstrike.net/phpBB3/viewt ... =27&t=2034
It tracks some character info and gold gained. Maybe you could modify it for what you want.
http://www.solarstrike.net/phpBB3/viewt ... =27&t=2034
It tracks some character info and gold gained. Maybe you could modify it for what you want.
Scout/Knight/Rogue 70/66/66
Re: Change exp Per Hour in Window title
This could work for what I want.
If I can find where the current window title is defined I can work from there.
Any help please,
Thanks
Yoder
If I can find where the current window title is defined I can work from there.
Any help please,
Thanks
Yoder
Re: Change exp Per Hour in Window title
Code: Select all
-- Set window name, install timer to automatically do it once a second
local displayname = string.sub(load_profile_name, 1, 4) .. "****";
setWindowName(getHwnd(), sprintf("RoM Bot %s [%s]", BOT_VERSION, displayname));
settings.loadProfile(load_profile_name);
settingsPrintKeys(); -- print keyboard settings to MM and log
registerTimer("timedSetWindowName", secondsToTimer(1), timedSetWindowName, load_profile_name);
player.BotStartTime_nr = os.time(); -- remember bot start time no reset
player.level_detect_levelup = player.Level; -- remember actual player level
store = CStore()
Ive found this in bot.lua and I think this is where it is setting the window name (probably why it says set window name) can I change this in a profile after its been set? or would I need to edit it here to make it an option first?
I was thinking their would need to be an option to read Inventory rather than read EXP.
Not asking for it to be done for me tho, Id like to work through this and actually see it happen, so just lookin for a nudge in the right direction here
Yoder
Re: Change exp Per Hour in Window title
Code: Select all
local LAST_PLAYER_X = 0;
local LAST_PLAYER_Z = 0;
function timedSetWindowName(profile)
local displayname = string.sub(profile, 1, 4) .. "****";
if( (player.X ~= LAST_PLAYER_X) or (player.Z ~= LAST_PLAYER_Z) ) then
setWindowName(getHwnd(), sprintf(language[600],
BOT_VERSION, displayname, player.X, player.Z, player.ExpPerMin, player.TimeTillLevel));
LAST_PLAYER_X = player.X;
LAST_PLAYER_Z = player.Z;
end
end
I assume as this refreshes when player coords change that this is where I want to make my changes
Now I can use help XD
Re: Change exp Per Hour in Window title
Code: Select all
setWindowName(getHwnd(), sprintf(language[600],
BOT_VERSION, displayname, player.X, player.Z, player.ExpPerMin, player.TimeTillLevel));
This should change the text to I like monkeys
Code: Select all
setWindowName(getHwnd(), "I like monkeys")
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: Change exp Per Hour in Window title
To put this into practic, I wonder if you could just replace the timedSetWindowName function somewhere in your own code. Then when the timer calls for it, it runs your version. I don't know if that would work but it's worth trying.
- 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: Change exp Per Hour in Window title
Code: Select all
storecharinfo(player.Name,"Eggs,"..inventory:itemTotalCount(204792)..",Cakes,"..inventory:itemTotalCount(204791))
Code: Select all
setWindowName(getHwnd(), sprintf(language[600],
BOT_VERSION, displayname, player.X, player.Z, player.ExpPerMin, player.TimeTillLevel));
Code: Select all
if( os.difftime(os.time(), self.LastExpUpdateTime) > self.ExpUpdateInterval ) then
--local newExp = RoMScript("GetPlayerExp()") or 0; -- Get newest value
--local maxExp = RoMScript("GetPlayerMaxExp()") or 1; -- 1 by default to prevent division by zero
local newExp = self.XP or 0;
local maxExp = memoryReadRepeat("intptr", getProc(), addresses.charMaxExpTable_address, (self.Level-1) * 4) or 1;
self.LastExpUpdateTime = os.time(); -- Reset timer
if( type(newExp) ~= "number" ) then newExp = 0; end;
if( type(maxExp) ~= "number" ) then maxExp = 1; end;
My problem is I dont know LUA at all yet and simply reading through code and mashing it together is tedious.
Ill keep at it, but does anyone know if I can define my own variables within my own addon?
something like
WaypointType = gather
namevar1 = monitored item 1
namevar2 = monitored Item 2
GatherItem1 = inventory:itemTotalCount(204792)
GatherItem2 = inventory:itemTotalCount(204791))
For example Below is not working code
Code: Select all
setWindowName(player.Name,"namevar1,"..GatherItem1..",namevar2,"..GatherItem2))
If you could define variables you could make a new variable using the ExpPerMin calcualtions as well
Code: Select all
self.ItemPerMin = ItemGainSum / ( valueCount * self.ItemUpdateInterval / 60 );
And thats my whole idea currently XD
Re: Change exp Per Hour in Window title
try
Code: Select all
setWindowName(getHwnd(),sprintf(player.Name.." "..GatherItem1.." "..GatherItem2))
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: Change exp Per Hour in Window title
Sigh still no worky
dont I need to define the variables tho
dont I need to define the variables tho
Re: Change exp Per Hour in Window title
sorry forgot the print and didn't check the ()
I assumed you had done the code for
and
already.
Code: Select all
setWindowName(getHwnd(),sprintf(player.Name.." "..GatherItem1.." "..GatherItem2))
I assumed you had done the code for
Code: Select all
GatherItem1 =
Code: Select all
GatherItem2 =
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: Change exp Per Hour in Window title
Interesting
attempt to concatenate global 'gatherItem2' (a nil value)
how do I define these variables
GatherItem 1 and 2
attempt to concatenate global 'gatherItem2' (a nil value)
how do I define these variables
GatherItem 1 and 2
Re: Change exp Per Hour in Window title
O.o nice with the fast responses
thats what I thought but was getting errors
Seems this is working.
So I assume I can then pull the calc function out of the Player.lua and remanufacture it to meet my needs while defining variables?
Thanks for the help so far
Yoder
thats what I thought but was getting errors
Seems this is working.
So I assume I can then pull the calc function out of the Player.lua and remanufacture it to meet my needs while defining variables?
Thanks for the help so far
Yoder
Re: Change exp Per Hour in Window title
Strange I can define static values but Im guessing im typing this wrong.
I want the values to be
GatherItem2 = inventory:itemTotalCount(204792)
but when I enter it like that I get the error
Inventory (a nil value)
I thought this was reading the inventory and making a count. doesnt the inventory update on startup ?
I want the values to be
GatherItem2 = inventory:itemTotalCount(204792)
but when I enter it like that I get the error
Inventory (a nil value)
I thought this was reading the inventory and making a count. doesnt the inventory update on startup ?
Re: Change exp Per Hour in Window title
Sorry I thought you had it mostly done, you just needed to know how to implement it.
Code: Select all
local GatherItem1 = inventory:itemTotalCount(208473) -- lvl 66 health pot
local GatherItem2 = inventory:itemTotalCount(208480) -- lvl 66 mana pot
setWindowName(getHwnd(),sprintf(player.Name.."health pots: "..GatherItem1.." mana pots: "..GatherItem2))
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: Change exp Per Hour in Window title
also there was a patch recently and the new addresses haven't been found yet, I am surprised you can do anything with bot =)
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: Change exp Per Hour in Window title
I was busy today bot is working and addressing for eggs seems ok now so thats why I was using them
I tested the readouts using the original linked script and was receving correct numbers
But Ill have to stop here for the night
I tested the readouts using the original linked script and was receving correct numbers
But Ill have to stop here for the night
Re: Change exp Per Hour in Window title
Good Morning
So here is what Ive thought about
But I get an error when starting the bot,
[/color]
So here is what Ive thought about
Code: Select all
local GatherItem1 = inventory:itemTotalCount(208473) -- lvl 66 health pot
local GatherItem2 = inventory:itemTotalCount(208480) -- lvl 66 mana pot
local ItemPerMin1 = GatherItem1 / ( valueCount * self.ExpUpdateInterval / 60 ); --This should still work
local ItemPerMin2 = GatherItem2 / ( valueCount * self.ExpUpdateInterval / 60 ); -- to calculate per min
local LAST_PLAYER_X = 0;
local LAST_PLAYER_Z = 0;
function timedSetWindowName(profile)
local displayname = string.sub(profile, 1, 4) .. "****";
if( (player.X ~= LAST_PLAYER_X) or (player.Z ~= LAST_PLAYER_Z) ) then
setWindowName(getHwnd(),sprintf(player.Name.."health pots: "..GatherItem1.." mana pots: "..GatherItem2));
LAST_PLAYER_X = player.X;
LAST_PLAYER_Z = player.Z;
end
end
Code: Select all
[b]5: attempt to index global 'inventory' (a nil value)[/b]
Re: Change exp Per Hour in Window title
I am guessing this is in functions.lua around line 400?
2 things come to mind
first is that classes/inventory.lua hasn't been loaded yet which is why it is returning inventory as nil.
the other is something else has gone wrong, there must be more to the error message. what else did it say?
2 things come to mind
first is that classes/inventory.lua hasn't been loaded yet which is why it is returning inventory as nil.
the other is something else has gone wrong, there must be more to the error message. what else did it say?
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: Change exp Per Hour in Window title
Where did you put the code? Or did you just edit the existing code?
If you edited the existing code, 'inventory' may not have been defined yet. I don't see any way around it.
But I think you could put this somewhere where it will be called after the bot has started, such as a userfunction or in an event such as an 'onload' event. It would then overwrite the existing code and inventory would already exist.
If you edited the existing code, 'inventory' may not have been defined yet. I don't see any way around it.
But I think you could put this somewhere where it will be called after the bot has started, such as a userfunction or in an event such as an 'onload' event. It would then overwrite the existing code and inventory would already exist.
- 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: Bing [Bot], Google [Bot] and 4 guests