any help with my code

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

any help with my code

#1 Post 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
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: any help with my code

#2 Post 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.
  • 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
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: any help with my code

#3 Post by botje »

problem is, i didnt change anything O.o

restart doesn't help either...
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: any help with my code

#4 Post by botje »

hmm, forfully adding a loadProfile() after the waypoint loading helped.

still weird it used to work fine O.o
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: any help with my code

#5 Post 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?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: any help with my code

#6 Post 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?
  • 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
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: any help with my code

#7 Post 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
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: any help with my code

#8 Post 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.
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: any help with my code

#9 Post 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?
  • 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: any help with my code

#10 Post 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.
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: any help with my code

#11 Post 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?
  • 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: any help with my code

#12 Post 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.
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: any help with my code

#13 Post by rock5 »

So do you think I should make it 7 characters like that and leave it up to the users yo be sensible?
  • 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
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: any help with my code

#14 Post by botje »

yes rock :)

and i thought the bot always updated that top details?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: any help with my code

#15 Post 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 "*".
  • 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
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: any help with my code

#16 Post by botje »

cool thanx :)
Post Reply