Page 1 of 1
any help with my code
Posted: Tue Dec 04, 2012 9:39 am
by botje
Code: Select all
function LogNextToon(waypoint)
ChangeChar();
yrest(2000)
waitForLoadingScreen();
yrest(5000)
player:update();
if getZoneId() == 400 then
player:target_NPC("Housekeeper");
sendMacro("SpeakFrame_ListDialogOption(1, 1)"); -- leaving the house
waitForLoadingScreen(20);
yrest(5000)
end
if waypoint == nil then
if getZoneId() == 1 then
loadPaths("Dailies/BoarDaily");
elseif getZoneId() == 2 then
loadPaths("Dailies/Disease Cure");
elseif getZoneId() == 4 then
loadPaths("Dailies/AslanValley");
else
printf("Detected Zone: "..getZoneId().."\n");
player:sleep();
end
else
loadPaths(waypoint);
end
end
for some reason this worked fine, and now all of a sudden, it doesnt load the right profile, keeps using the first one i load, no changing to the userdefault one O.o
Re: any help with my code
Posted: Tue Dec 04, 2012 9:57 am
by rock5
Sometimes if you use other options it messes up the functioning of the ChangeChar function. I don't remember which but I'm pretty sure you can't use the old LoginNextToon option with ChangeChar. So does it still do it if you restart the client?
Or maybe you decided to try the "fastLoginRelog" option in the loginxml addon file accountlogin.lua.
Re: any help with my code
Posted: Tue Dec 04, 2012 10:03 am
by botje
problem is, i didnt change anything O.o
restart doesn't help either...
Re: any help with my code
Posted: Tue Dec 04, 2012 1:08 pm
by botje
hmm, forfully adding a loadProfile() after the waypoint loading helped.
still weird it used to work fine O.o
Re: any help with my code
Posted: Wed Dec 05, 2012 10:32 am
by botje
ok, i got it down to this, it does change accounts, but does'nt change the text on the MM window title, any idea how that could happen?
Re: any help with my code
Posted: Wed Dec 05, 2012 11:07 am
by rock5
I believe the name in the title is the name of the profile. So it wouldn't change unless you loaded a different profile. Do you think it would make more sense to use the characters name?
Re: any help with my code
Posted: Wed Dec 05, 2012 7:29 pm
by botje
nono, thats the problem, i see MM print out the line loading profile blabla, but it does'nt change ontop of it o.o
Re: any help with my code
Posted: Wed Dec 05, 2012 7:40 pm
by lisa
if you are just talking about the details on the top of the MM window, that won't be changed with the ChangeChar, it is set in bot.lua you would need to change it in the changechar function.
Code: Select all
unregisterTimer("timedSetWindowName");
registerTimer("timedSetWindowName", secondsToTimer(1), timedSetWindowName, player.Name);
unless of course you did that already in the function, I didn't look.
Re: any help with my code
Posted: Wed Dec 05, 2012 10:23 pm
by rock5
I remember I had to move some of the code for the RC into the timed event to fix XP gain calculations but otherwise it still works the same. The reason the name doesn't change is because it isn't updated. It only ever uses the initial value given to it.
But if we change it to use "player.Name" then it will update as player.Name updates and is a really quick fix.
I just have 1 question. Does anyone know why it truncates the name to 4 characters then adds 4 useless stars **** to the name?
Re: any help with my code
Posted: Wed Dec 05, 2012 10:34 pm
by lisa
rock5 wrote:I just have 1 question. Does anyone know why it truncates the name to 4 characters then adds 4 useless stars **** to the name?
My guess is because when people upload pics of their errors it would atleast prevent the full character name being posted.
Re: any help with my code
Posted: Thu Dec 06, 2012 2:09 am
by rock5
That's annoying. People shouldn't really post pics of mm and it wont help if the profile name is visible from when it loads. But ok, 4 characters is usually enough to identify the character but I don't see why we need to waste space with 4 stars.
Hm.. Maybe I should mask the profile name when loading too?
Re: any help with my code
Posted: Thu Dec 06, 2012 2:23 am
by lisa
in my setwindow userfunction I didn't bother to mask player name.
Code: Select all
setWindowName(getHwnd(),sprintf(player.Name.." Max HP: "..player.MaxHP.." Actual HP: "..player.HP))
Code: Select all
local _charname = string.sub(player.Name,1,7)
setWindowName(getHwnd(),sprintf(_charname..". ".._itemname..": ".._currentitems.." (".._itemsperhour.."/h) Time(h): ".._printtime))
just made it smaller if more space was needed for other important info.
Re: any help with my code
Posted: Thu Dec 06, 2012 3:16 am
by rock5
So do you think I should make it 7 characters like that and leave it up to the users yo be sensible?
Re: any help with my code
Posted: Thu Dec 06, 2012 3:37 am
by botje
yes rock
and i thought the bot always updated that top details?
Re: any help with my code
Posted: Thu Dec 06, 2012 4:13 am
by rock5
botje wrote:yes rock
and i thought the bot always updated that top details?
It does update the other details but not the profile name. I'll change it to using 7 characters of the player.Name in my next commit then it should update.
Edit: I think I'll use 8 characters as it is now. If the name is 8 characters or less then it just uses that. If the name is more than 8 characters then it will use 7 characters plus 1 "*".
Re: any help with my code
Posted: Thu Dec 06, 2012 7:54 am
by botje
cool thanx
