What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

critical bug with while / if statements

swolbyn

New Member
Joined
Apr 24, 2010
Messages
796
Reaction score
7
UPDATE: I attached a new profile to a post reply. I think I've narrowed the exact circumstances down. Please test with if_while_bug.xml

I've come across a show stopper bug for me in my current profile project.

If you put a while loop inside an if statement when you reach the end of the if statement the bot freaks out, walks to a location (i guess before if statement?) and stands there.... doing nothing. forever. No code below that if statement is ever reached.

here are some examples.

Test_Profile_1 is a snippet of a profile that does not work. It's a pretty simple profile i start while in game in festering woods near an entrance to crypt of ancients. its supposed to simply walk inside... pause then exit the dungeon, then walks some waypoints around and then continue on its way.

What actually happens is after the few waypoints (that are inside the if statement) it stops. it never reaches the code after that if. i've tried raw moveto's outside of another if, etc. nothing gets executed.

Test_Profile_2 is a modified version where i moved the while outside and below the first if. just to demonstrate this works as expected. it continues on its way. unfortunately this does not work for me. I have to nest a while inside the if because i need him to clear the dungeon then walk specific waypoints to get away from the dungeon entrance (because the nav system is severely horrible right around all the dungeon entrances in festering woods).

I'm attaching a log that shows quite a few attempts by me to get it functioning.

This is a pretty major whopper of a problem, It would be great to get it fixed soon.

update: it's not limited to while loops... i changed the while to an if and nested if statements are triggering the same bug. attaching Test_Profile_3 with that setup

thanks
 

Attachments

Last edited:
OK. I think this has to do with changing worldid's in combination with nested tags. I put together a much more simple profile that should be very easy to test out and verify for the devs.....

It's a modified sarkoth profile. Just choose "act 1: legacy of cain: explore cellar"

Here's what it does. If sarkoth isnt up it runs back to the waypoint and restarts. we don't care we need to see him enter the dungeon.

If sarkoth is up the bot will go inside, kill then leave the dungeon.

Once outside it *should* run back to the waypoint then leave game. This does not happen though.

Instead he stands outside the dungeon "stuck" in a endless loop of doing absolutely nothing. Nothing after the If wil execute. It doesn't seem to happen unless you change worlds though. very odd but happens every time.
 

Attachments

im having this issue with rads act 1 champ profile my guy comes out of warriors rest or CoTA and wont attack sometimes it just tries to run the waypoints some times just stops some times just runs past everything ignoring combat.
 
Sounds like a big problem. And lord knows my guy has been left standing for hours on a number of occasions..."bump!" Ty for putting in the time to debug, too.
 
I just want to say something, why even use While? I mean, ive looked at you profile and i done see the meaning? Like the sarkoth profile, you dont have to pile if on if on if... Its pretty worthless and i never do it!

Code:
		<!-- Choose Act 1: The Legacy of Cain: Explore Cellar -->
		<If condition="Me.IsInTown"> <!-- IF WE ARE IN TOWN THIS WILL BE EXECUTED, YOU DONE NEED WHILE -->
			<UseWaypoint questId="1" x="2980.667" y="2834.59" z="24.90045" actorId="223757" waypointNumber="1" />
			<WaitTimer questId="1" waitTime="600" />
		</If>

		<If condition="ZetaDia.CurrentWorldId == 71150"><!-- THIS LINE DOESNT DO A SHIT.... SINCE TOWN ALSO GOT 71150 A CORRECT ANTI TOWN CHECK WOULD BE <If condition="ZetaDia.CurrentWorldId == 71150 and (not Me.IsInTown)"> -->
			<MoveTo questId="1" x="2012.618" y="2578.091" z="27.1" pathPrecision="3" />
			<MoveTo questId="1" x="2043.391" y="2540.704" z="27.1" pathPrecision="3" />

			<!-- Checking for cellar entrance-->
			<If condition="ActorExistsAt(176007, 2059.629, 2478.667, 27.02374, 15)">
				<MoveTo questId="1" x="2063.032" y="2479.481" z="29.26121" pathPrecision="3" />
				
				<!-- Interact with cellar -->
				<UseObject questId="1" x="2075.159" y="2498.607" z="27.1" actorId="176007" isPortal="True" destinationWorldId="106746" />
				<WaitTimer questId="1" waitTime="600" />
                        </If><!-- I WOULD MOVE THIS IF END TAG HERE BECAUSE THE "CHECK" ENDS HERE AND IT WONT FUCK UP THE SCRIPT-->
				<If condition="ZetaDia.CurrentWorldId == 106746"><!-- I WOULD USE IF HERE BECAUSE WE DONT NEED A LOOP HERE, WE SIMPLY NEED TO GO DOWN, KILL AND THEN BACK UP AGAIN -->
					<MoveTo questId="1" x="120.5089" y="156.2077" z="0.1000008" pathPrecision="3" />
					<MoveTo questId="1" x="120.1743" y="139.2978" z="0.1000006" pathPrecision="3" />
					<MoveTo questId="1" x="115.5175" y="106.5193" z="0.09999999" pathPrecision="6" />
					<MoveTo questId="1" x="120.1743" y="139.2978" z="0.1000006" pathPrecision="3" />
					<MoveTo questId="1" x="120.5089" y="156.2077" z="0.1000008" pathPrecision="3" />
					<MoveTo questId="1" x="74" y="160" z="1.411117" pathPrecision="3" />
					<UseObject questId="1" x="74" y="160" z="1.411117" actorId="175467" isPortal="True" destinationWorldId="71150" /> <!-- THIS PART OF THE CODE WOULD END YOUR WHILE TAG ANYWAY, SO WHY USE IT? -->
					<WaitTimer questId="1" waitTime="2000" />
				</If>
			
			
			<!-- This is the coords of the old ruins waypoint -->
			<!-- It will never get to this code --> <!-- BECAUSE YOU HAVE DONE IT WRONG... -->
			<MoveTo questId="1" x="1976.71" y="2788.136" z="42.135" pathPrecision="3" />
			<LeaveGame reason="RESTART!" />
		</If>

I always use If tags.
Only time i use While is on bosses and even then i find that its SHIT, what you should do is using the movement waypoints to attack the boss while you try to reach a new waypoints, that will make your char to stay in combat.
But sometimes its hard to do, like Kulle... And then we need to use ONE While tag
Never build IF on IF on IF on While, its wrote to fail and doesnt follow any logic...
 
Sometimes you need while. As i said, the sarkoth example is just to display the bug. That is not my real sarkoth profile lol. I was trying to mimic the buggy behavior. Thank you for completely missing the point. Your nice little silly comments are hilarious. Preaching to the choir.

The profile i'm working on is very complex and i absolutely have to nest the tags. Period. It also affects if tags not while. It actually has nothing to do with while specifically.

Believe me when I say i've tried every manner of mixing it up with if's and whiles. None work for my current project. Bottom line i have to have an if with a nested if inside (movement inside new dungeon after it enters portal then to exit portal) then does some movement afterwards to get away from buggy nav dungeon entrance. This scenario doesn't work right now, at all.

and simply saying oh dont do that isn't acceptable. It's part of the profile scripting. The tags are there and they should work properly. It's a fairly powerful scripting language and if it worked properly it would be fantastic.

here's a quick very basic pseudocode example of what i mean.

Code:
if (worldid == someworldidoutside && dungeonisspawned){
  moveto 1
  moveto 2
  useobject (enterdungeon)
  if worldid == dungeonid{
    moveto 3
    moveto 4
    moveto 3
    useobject (exitdungeon)
  }
  moveto 2
  moveto 1
}
do something else here. move to next area

basic explanation. dungeon entrance has severely buggy nav around it. you have to do some very small specific movetos to get inside without glitching and you have to do the same movements in reverse to get away from it when you are back outside.

but you only want to do the before and after movements if said dungeon happens to be up. so they have to be nested in an if otherwise the points might not even exist (might be a mountain spawned in those coords, etc)

it's really not that complex of a scenario. it should be supported, i'm certain it's a bug

also. while is more reliable i've found. use it in all my profiles.
 
Last edited:
Sometimes you need while. As i said, the sarkoth example is just to display the bug. The profile i'm working on is very complex and i absolutely have to nest the tags. Period. It also affects if tags not while. It actually has nothing to do with while specifically.

Believe me when I say i've tried every manner of mixing it up with if's and whiles. None work for my current project. Bottom line i have to have an if with a nested if inside (movement inside new dungeon after it enters portal then to exit portal) then does some movement afterwards to get away from buggy nav dungeon entrance. This scenario doesn't work right now, at all.

and simply saying oh dont do that isn't acceptable. It's part of the profile scripting. The tags are there and they should work properly. It's a fairly powerful scripting language and if it worked properly it would be fantastic.
Yeah but you also have to understand how c# reads the lines you are writing, if you can send the profile in a PM i can take a look at it, ive done ALOT of complex thing and i hope i can help you! I would say EVERYTHING is possible todo atm. You just need to know how!
 
Yeah but you also have to understand how c# reads the lines you are writing, if you can send the profile in a PM i can take a look at it, ive done ALOT of complex thing and i hope i can help you! I would say EVERYTHING is possible todo atm. You just need to know how!

it's not. trust me i know what i'm doing. I do not need your assistance. have you used any of my profiles?
 
Yeah but you can do like this, what ive done for festering woods and i wrote this when i was pretty noobish...

Code:
	<MoveTo questId="1" x="605.8259" y="867.796" z="20.1" name="Festering Woods #5" pathPrecision="1" />
	<MoveTo questId="1" x="600.9124" y="906.9619" z="20.1" name="Looking for CotA #1" pathPrecision="1" />
	<If condition="ActorExistsAt(176008, 546.2001, 876.5851, 16.02718, 15)  and Zeta.ZetaDia.CurrentWorldId==71150">
		<ToggleTargeting questId="1" combat="False" looting="False" lootRadius="70" killRadius="30" />
		<WaitTimer waitTime="100" />
		<MoveTo questId="1" x="581.181" y="920.6775" z="20.1" name="In #1" pathPrecision="1" />
		<MoveTo questId="1" x="568.0519" y="912.9675" z="19.69943" name="In #2" pathPrecision="1" />
		<MoveTo questId="1" x="561.685" y="901.7787" z="16.8247" name="In #3" pathPrecision="1" />
		<MoveTo questId="1" x="559.4897" y="887.8422" z="16.25267" name="In #4" pathPrecision="1" />
		<UseObject questId="1" x="555.1432" y="883.5889" z="15.85017" actorId="176008" isPortal="True" destinationWorldId="60394" />
	</If>
	<If condition="Zeta.ZetaDia.CurrentWorldId==60394">
		<ToggleTargeting questId="1" combat="True" looting="True" lootRadius="70" killRadius="30" />
		<MoveTo questId="1" x="318.567" y="228.7159" z="-9.290613" pathPrecision="5" />
		<MoveTo questId="1" x="236.7522" y="361.2693" z="-16.84969" pathPrecision="5" />
		<MoveTo questId="1" x="148.5845" y="338.6848" z="-14.60206" pathPrecision="5" />
		<MoveTo questId="1" x="256.621" y="381.7021" z="-17.75699" pathPrecision="5" />
		<MoveTo questId="1" x="298.8536" y="379.7181" z="-37.90237" pathPrecision="5" />
		<While condition="Zeta.ZetaDia.CurrentWorldId==60394">
			<WaitTimer waitTime="100" />
			<MoveTo questId="1" x="236.1708" y="376.3336" z="-15.05489" pathPrecision="1" />
			<MoveTo questId="1" x="297.7783" y="250.1982" z="-10.12247" pathPrecision="1" />
			<MoveTo questId="1" x="285.0051" y="201.6187" z="-6.497152" pathPrecision="1" />
			<WaitTimer waitTime="1000" />
			<ToggleTargeting questId="1" combat="False" looting="False" lootRadius="70" killRadius="30" />
			<UseObject questId="1" x="273.4551" y="184.6861" z="-5.969828" actorId="176008" isPortal="True" destinationWorldId="71150" />
			<WaitTimer waitTime="100" />
		</While>
	</If>
	<If condition="ActorExistsAt(176008, 546.2001, 876.5851, 16.02718, 15)  and Zeta.ZetaDia.CurrentWorldId==71150">
		<MoveTo questId="1" x="559.4897" y="887.8422" z="16.25267" name="Out #1" pathPrecision="1" />
		<MoveTo questId="1" x="561.685" y="901.7787" z="16.8247" name="Out #2" pathPrecision="1" />
		<MoveTo questId="1" x="568.0519" y="912.9675" z="19.69943" name="Out #3" pathPrecision="1" />
		<MoveTo questId="1" x="581.181" y="920.6775" z="20.1" name="Out #4" pathPrecision="1" />
		<ToggleTargeting questId="1" combat="True" looting="True" lootRadius="70" killRadius="30" />
	</If>
	<MoveTo questId="1" x="624.2868" y="949.4435" z="20.1" name="Festering Woods #6" pathPrecision="1" />
 
it's not. trust me i know what i'm doing. I do not need your assistance. have you used any of my profiles?
Well if you dont want help, fuck it then...

Edit: DONT post threads like thes because what you are displaying is a lack of knowledge :S
Im just trying to be nice and helping a fellow developer out!
 
Last edited:
Yeah but you can do like this, what ive done for festering woods and i wrote this when i was pretty noobish...

Code:
    <MoveTo questId="1" x="605.8259" y="867.796" z="20.1" name="Festering Woods #5" pathPrecision="1" />
    <MoveTo questId="1" x="600.9124" y="906.9619" z="20.1" name="Looking for CotA #1" pathPrecision="1" />
    <If condition="ActorExistsAt(176008, 546.2001, 876.5851, 16.02718, 15)  and Zeta.ZetaDia.CurrentWorldId==71150">
        <ToggleTargeting questId="1" combat="False" looting="False" lootRadius="70" killRadius="30" />
        <WaitTimer waitTime="100" />
        <MoveTo questId="1" x="581.181" y="920.6775" z="20.1" name="In #1" pathPrecision="1" />
        <MoveTo questId="1" x="568.0519" y="912.9675" z="19.69943" name="In #2" pathPrecision="1" />
        <MoveTo questId="1" x="561.685" y="901.7787" z="16.8247" name="In #3" pathPrecision="1" />
        <MoveTo questId="1" x="559.4897" y="887.8422" z="16.25267" name="In #4" pathPrecision="1" />
        <UseObject questId="1" x="555.1432" y="883.5889" z="15.85017" actorId="176008" isPortal="True" destinationWorldId="60394" />
    </If>
    <If condition="Zeta.ZetaDia.CurrentWorldId==60394">
        <ToggleTargeting questId="1" combat="True" looting="True" lootRadius="70" killRadius="30" />
        <MoveTo questId="1" x="318.567" y="228.7159" z="-9.290613" pathPrecision="5" />
        <MoveTo questId="1" x="236.7522" y="361.2693" z="-16.84969" pathPrecision="5" />
        <MoveTo questId="1" x="148.5845" y="338.6848" z="-14.60206" pathPrecision="5" />
        <MoveTo questId="1" x="256.621" y="381.7021" z="-17.75699" pathPrecision="5" />
        <MoveTo questId="1" x="298.8536" y="379.7181" z="-37.90237" pathPrecision="5" />
        <While condition="Zeta.ZetaDia.CurrentWorldId==60394">
            <WaitTimer waitTime="100" />
            <MoveTo questId="1" x="236.1708" y="376.3336" z="-15.05489" pathPrecision="1" />
            <MoveTo questId="1" x="297.7783" y="250.1982" z="-10.12247" pathPrecision="1" />
            <MoveTo questId="1" x="285.0051" y="201.6187" z="-6.497152" pathPrecision="1" />
            <WaitTimer waitTime="1000" />
            <ToggleTargeting questId="1" combat="False" looting="False" lootRadius="70" killRadius="30" />
            <UseObject questId="1" x="273.4551" y="184.6861" z="-5.969828" actorId="176008" isPortal="True" destinationWorldId="71150" />
            <WaitTimer waitTime="100" />
        </While>
    </If>
    <If condition="ActorExistsAt(176008, 546.2001, 876.5851, 16.02718, 15)  and Zeta.ZetaDia.CurrentWorldId==71150">
        <MoveTo questId="1" x="559.4897" y="887.8422" z="16.25267" name="Out #1" pathPrecision="1" />
        <MoveTo questId="1" x="561.685" y="901.7787" z="16.8247" name="Out #2" pathPrecision="1" />
        <MoveTo questId="1" x="568.0519" y="912.9675" z="19.69943" name="Out #3" pathPrecision="1" />
        <MoveTo questId="1" x="581.181" y="920.6775" z="20.1" name="Out #4" pathPrecision="1" />
        <ToggleTargeting questId="1" combat="True" looting="True" lootRadius="70" killRadius="30" />
    </If>
    <MoveTo questId="1" x="624.2868" y="949.4435" z="20.1" name="Festering Woods #6" pathPrecision="1" />

Basic if / while nesting is something that is supported and the bug only exists when you change worldid's. If no nesting worked at all, then maybe I would accept that. But that's just not the case.

But yeah. that's my backup plan if this isn't fixed fairly quickly. I just didn't want to bloat the profile any more than absolutely necessary. I mean breaking a single if out into 3 different ones is pretty lame to have to do. =\
 
Last edited:
Well if you dont want help, fuck it then...

No help is needed. I'm simply bringing to light a bug in the profile parsing engine to get it fixed. That is all. if you aren't a dev there's no need to dirty up the thread.
 
Basic if / while nesting is something that is supported and the bug only exists when you change worldid's. If no nesting worked at all, then maybe I would accept that. But that's just not the case.
Yes ofc. Haha i dont see the problem, ive posted solutions for both your problems now!

Edit: Seems you dont understand what im trying to say... There probably is no bug, just bad coding!
 
Last edited:
Yes ofc. Haha i dont see the problem, ive posted solutions for both your problems now!

I only ever had one problem and it's still there.

What you are saying is like if there were a bug with the combat engine that made only daggers work properly. "Oh no big deal just use a dagger".

Trust me if this goes much more longer ignored, I will be forced to go back and ghetto the profile up with a bunch of more bloated tags. I would however have to severely scale down the profile which would essentially make it useless so I don't really want to put my name on something i feel is sub par =\
 
Last edited:
Well if you dont want help, fuck it then...

Edit: DONT post threads like thes because what you are displaying is a lack of knowledge :S
Im just trying to be nice and helping a fellow developer out!

I display a lack of knowledge by properly using nested tags? Seriously? I'm a developer by trade, what you imply is ridiculous. Because you just hack it up and put a million seperate unrelated if's you are superior in some way with coding? Please. I've seen your stuff. I'll just say this, any profile of yours I've loaded up i had to fix numerous bugs to even get it running. Just stop and stick your nose somewhere else kindly sir.
 
I display a lack of knowledge by properly using nested tags? Seriously? I'm a developer by trade, what you imply is ridiculous. Because you just hack it up and put a million seperate unrelated if's you are superior in some way with coding? Please. I've seen your stuff. I'll just say this, any profile of yours I've loaded up i had to fix numerous bugs to even get it running. Just stop and stick your nose somewhere else kindly sir.
:D Sorry.
"Intellectuals solve problems, geniuses prevent them."
-Albert Einstein
 
Back
Top