Author Topic: Help with bugz. Can't figure this one out  (Read 4258 times)

0 Members and 1 Guest are viewing this topic.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +11
  • Referrals: 5
    • View Profile
Help with bugz. Can't figure this one out
« on: June 16, 2010, 06:31:52 PM »
0
Disclaimer: been looking for PSL header info, but cant find it. Of course, this is nowhere near ready. My problem is three fold.
1) Despite numerous configurations, have to keep the health bar in original place, or script breaks. Tried offset sub and generator (now commented out), tried hard coding the cont pos + location, and tried fixed location (cheat method).

2) Archcure will not target pet. But will target toon if ID is reset, OR if you changed to Event Macro 23.

3) Most beguiling. This script was (almost) working last night. Only thing left was arch cure, then continue.
NOW, it continually loops at my distance check of greater than 10 from the pet, even though finddist is 1. I have messed around with copies, and cant get it back to working order.

Have run this through scriptuo, corrected all but one problem. Line 116 is nested without return. Don't rightly understand that fully.

The script is meant to evaluate pet condition, and cast / use aids depending on distance (for now, user configs coming once operational) and condition (hurt, poison, mortal). I have set several conditions meant to focus on playability and survivability of the player. Most scripts wont allow you to peace or provo while they are active. I plan to enable all skills through journal scan once I get it casting correctly.
Still working on mana conservation, fast cast timing and checking for skill use (got those lined up though, thanks to snippets section).

Have an on-the fly menu set-up planned out, thanks to TM's menu post. Still trying to figure out how he got his tool gump health percent to work so well (want to add that in as well).

I have been putting a lot of time into this, and a lot of research. Any help to get me unstuck would be greatly appreciated. Almost ready to pull my hair out. Gotta grow some first though >:(. Thank you for the help and ideas so far! This is gonna be a fun project, once I actually know what I am doing.

script pulled from attachment. Two major bugs fixed.
« Last Edit: June 18, 2010, 06:47:16 AM by baldielocks »

Scrripty

  • Guest
Re: Help with bugz. Can't figure this one out
« Reply #1 on: June 16, 2010, 08:11:12 PM »
0
You're getting some of this all backwards.  You need to watch your script flow and understand how things are done in euo a bit better.  Example:

Code: [Select]
;========Set Pet ===============
set !pet1 #ltargetID
set %findpetid #findid
set %pet1 #findid
finditem !pet1
event property #findid
set %petname #property

In that code you're trying to set your %pet1 variable to #findid, but you haven't actually found an id yet...  you set your #targcurs to 1 then click your pet, and that sets it to #ltargetid, but it doesn't set it to #findid.  You're also setting %findpetid to #findid and you haven't actually found your pets id...  #findid usually isn't set until you find the item in game with a finditem command.  So you "set" the #ltargetid with a #targcurs, then you need to do a finditem for the #ltargetid variable to find your pet, and IF it's found, then you can set %pet1 and %findpetid to #findid.  If you're ever not sure that a variable is holding the correct data, you can always do an "event exmsg #charid 3 0 %variablename" to find out what is held in the variable.... makes it easy to know if you got the right data.  That was just in the first few lines of code, so I'm going to assume you need to examine the script a lot more carefully and see what else is "out of order." :)  You COULD set your variables to the #ltargetid tho as that's the same as it's #findid for your pet...  Then you don't even need to do a slower finditem.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +11
  • Referrals: 5
    • View Profile
Re: Help with bugz. Can't figure this one out
« Reply #2 on: June 17, 2010, 07:48:21 AM »
0
Thanks Twinkle McNugget. I AM still learning. This is only my second full script attempt. Be some time before I know exactly what to look for in all instances. Having more experienced people to point out my misconceptions makes my learning curve vertical. Appreciate you taking the time to evaluate it for me. *heads off to re-write*

Would you know a resource I could reference on nested codes? Been looking, but don't even know if I am searching for the right thing. That's the hardest part for me. I can SEE where the code should head to. I can conceptualize the flow. I pretty much think in pseudo- code all day at work.
But I don't know the vocabulary to correctly express my intent (yet). So I need a tech dictionary, from geek to nerd. And if you don't know the word you are looking for, it is difficult to find that word. But that's why I am on these boards, to learn those words.

And yes, I have the Easyuo Wiki bookmarked, and displayed on two screens while I hack at the script. (saw you suggest that in another thread for concatenation).

Scrripty

  • Guest
Re: Help with bugz. Can't figure this one out
« Reply #3 on: June 17, 2010, 08:42:23 AM »
0
The very best way to learn things is to pick apart other peoples scripts.  Sometimes it's hard, and I get stumped looking at peoples code a lot too (TM's for example).  But I promise, if you stare at something long enough, and rip it up, it'll make sense.  I'm sure a lot of us here will agree, we've all stared at code and went "HUH?"  Eventually it makes sense tho if you stare long enough.  My suggestion is to only look at peoples code that you know are good scripters, so you learn good habits.  Like EN, and TM here have nicely organized and clean coding... it's over your head for sure, but you'll learn a lot from looking at it.  Just remember, it's all done one line at a time, left to right.  It's that easy. :)

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Help with bugz. Can't figure this one out
« Reply #4 on: June 17, 2010, 08:47:58 AM »
0
Left to right??!?! So THAT'S what I've been doing wrong!

:P
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +11
  • Referrals: 5
    • View Profile
Re: Help with bugz. Can't figure this one out
« Reply #5 on: June 17, 2010, 09:58:15 AM »
0
left to right, even when the operator is right associative. got it ???

Advice I have been following for some time. You are quite right, staring at the code is a safe and effective alternative to hallucinogens. That's actually why I picked this script attempt. It's based on the pet tool gump code from TM. Since noone else based anything off of it since he wrote it (that I can tell) I figgered it was a great place to start, since it is in an area I can claim competence in (Tamers and Bards).
Since I could not understand a danged thing, I kind of wound up in the woods. BUT that works, since I can now understand a lot more of his code based on my attempts. Sort of like Edison, I now know a 1,000 ways NOT to do it. :P

Offline Paulonius

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Help with bugz. Can't figure this one out
« Reply #6 on: June 17, 2010, 10:15:20 AM »
0
I also like to use a lot of these at various points throughout a process that I am trouble shooting.  

Code: [Select]
event exmsg #charid 3 4 TEST MESSAGE I usually put where I am in the script here
wait 5

I also put in variables that I am working with to make sure they are carrying values I expect.

Then I open my journal and run the piece I am working through.  
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Scrripty

  • Guest
Re: Help with bugz. Can't figure this one out
« Reply #7 on: June 17, 2010, 12:16:09 PM »
0
You can also add the variables to EUO's variable list, and watch them real time.  And add a pause after the variable is set to give you time to make sure it's correct without stopping execution of the script. :)

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Help with bugz. Can't figure this one out
« Reply #8 on: June 17, 2010, 12:28:16 PM »
0
Have a look at THIS, you can put your own comments into a script and have them show up in a menu so you see what is going on.

And you could edit THIS to include your variables. It'll monitor them for you and you can see what's happening.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +11
  • Referrals: 5
    • View Profile
Re: Help with bugz. Can't figure this one out
« Reply #9 on: June 17, 2010, 05:04:17 PM »
0
guess i was .... tired last night. Yah Yah, THAT's the ticket. Turns out SOMEONE must have deleted a } or two.... when I was not looking.... in my check distance < 10 line. So it would pass the if statement and goto mainloop.

Good news is , bug 3 is fixed, and script is mostly functional again. still stuck on the gump and arch cure not targetting. Arch cure is a BIIIG hold-up. Thanks for the tips all, I used those to figure out my error.

Scrripty

  • Guest
Re: Help with bugz. Can't figure this one out
« Reply #10 on: June 17, 2010, 05:07:23 PM »
0
guess i was .... tired last night. Yah Yah, THAT's the ticket. Turns out SOMEONE must have deleted a } or two.... when I was not looking.... in my check distance < 10 line. So it would pass the if statement and goto mainloop.

Good news is , bug 3 is fixed, and script is mostly functional again. still stuck on the gump and arch cure not targetting. Arch cure is a BIIIG hold-up. Thanks for the tips all, I used those to figure out my error.

Here's another big one:  Use ScriptUO until you get used to syntax.  Then still use it. :)

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +11
  • Referrals: 5
    • View Profile
Re: Help with bugz. Can't figure this one out
« Reply #11 on: June 19, 2010, 04:33:46 PM »
0
Okay, made a TON of progress. But stuck again. Hit the edge of my learning curve I think.
Before I post it all, according to board etiquette, how should I do it? Attach script to OP? Attach script to new post in OP? Create new post?

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +11
  • Referrals: 5
    • View Profile
Re: Help with bugz. Can't figure this one out
« Reply #12 on: July 06, 2010, 08:53:30 PM »
0
been working on this constantly. unfortunately, that means 1 hour a day with my new hours. Script now in menu format. Another hill in my learning curve. Script has a full featured non-interrupt sub, plus on-the fly updates of all waits and heal percent. I have it reliably detecting poison and casts arch-cure w/ auto target system. Looking to post it for bebug next week possibly.

Tags: