Author Topic: #contblah issues [SOLVED] - PEBKAC  (Read 4787 times)

0 Members and 1 Guest are viewing this topic.

Offline lydaanTopic starter

  • Jr. Member
  • **
  • Posts: 70
  • Activity:
    0%
  • Reputation Power: 3
  • lydaan has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
#contblah issues [SOLVED] - PEBKAC
« on: February 03, 2016, 11:17:48 AM »
0
having a hard time with #contthings... everything was working fine until I realized the "save diskette icon" wasn't working and my last week of edits disappeared.  :'(

In my miner, after crafting a shovel, the crafting gump isn't dissapearing (this issue is due to #lpc stuff that I need to work out), but it seems that when my miner recalls, it pushes the craftgump behind something, and #contthings do not work on it.

Just wondering if anyone knows of a priority of different gumps and which one is currently on top, or had similar issues?

*edit*

Yay learning!

The propblem was 100% PEBCAK

paraphrase:

Code: [Select]
finditem twj * c_ , #backpackid
set %digshov #findid
if #findcnt = 0
   gosub tinkershovel    <--- sets tool kit as #lobjectid
set #lobjectid %digshov <--- %digshov is null, so it defers to the previos #lobjectid
event macro 17 0
...

yay learning! Glad I could share.
« Last Edit: February 03, 2016, 05:08:01 PM by lydaan »

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +600
  • Referrals: 2
    • View Profile
Re: #contblah issues
« Reply #1 on: February 03, 2016, 11:47:26 AM »
0
By default the craft gumps don't disappear, you have to click "Exit" or right mouse click somewhere on the Gump. In my crafting subs I pass a variable for whether I want the gump to exit or not and, if so, click X Y for Exit.

Maybe I am misunderstanding ths issue?

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline lydaanTopic starter

  • Jr. Member
  • **
  • Posts: 70
  • Activity:
    0%
  • Reputation Power: 3
  • lydaan has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: #contblah issues
« Reply #2 on: February 03, 2016, 11:54:18 AM »
0
The issue actually turned out to  be EUO... or UO... or something... anyway, here's what I tried:

Code: [Select]
while #contkind <> gjz
   {
   }
   click #contposx #contposy f r
   set %timeout1 #systime
   while #contkind <> gjz && #systime - %timeout1 < 4000
   {
   }
   wait 20
   tinkerreturn:
   if #contkind = gjz
      click #contposx #contposy f r

I doubled down on the click r... no fix, so I added that 4 second wait in there to see what was going on. I have no idea why it was doing this, but it stored the gump, hidden, and as soon as the sub returned it opened the gump again... wth... anyway, adding a goto at the point of return seems to have fixed the problem. I have no clue, but it's closing now

« Last Edit: February 03, 2016, 12:17:41 PM by lydaan »

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +600
  • Referrals: 2
    • View Profile
Re: #contblah issues
« Reply #3 on: February 03, 2016, 02:13:21 PM »
0
I do a lot of scripting with Gumps and have never experienced the issue you described.

Quick note, you are closing your While loops before you ever run anything.

Keep it simple, after you are done making a shovel just click Exit ("click #contposx+30 #contposy+450" if a crafting gump on OSI). Don't forget to wait until the Gump returns after making the shovel before you move to the next one. I would also suggest eliminating #contkind.

I use a "ClickAndWait" sub which clicks where you want it to click and waits for the Gump to respond before moving on to the next line of code. Fell free to check out my standard subs in my script library, maybe it will help.

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline lydaanTopic starter

  • Jr. Member
  • **
  • Posts: 70
  • Activity:
    0%
  • Reputation Power: 3
  • lydaan has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: #contblah issues
« Reply #4 on: February 03, 2016, 03:58:16 PM »
0
Quick note, you are closing your While loops before you ever run anything.

LOL hahaha
so I like to make my waits variable rather than static... In my experience (may be different on OSI) after clicking the shovel button, you have to wait for the gump to reappear to close it, this takes somewhere beteween 1400 and 1800ms sometimes more (I also have to deal with 4 second saves every now and then, where the screen freezes)

I could use a wait 20 which would cover the gump reappearing most of the time, but that doesn't cover the server saves, so I'd have to go with a wait 90 to compensate, but that would be real lame as it wastes a lot of time, so writing my waits like:

Code: [Select]
while something not true || something true
{
}

allows for variable wait times that always wait the minimal amount of time (including lag) before performing the next action. I sometimes write gotos with ifs if the procedure calls for it:

Code: [Select]
set %propcheck #property
finditem * c
propwait:
event property #findid
if #property = %propcheck
   goto propwait

that's not really the best example, but I did use something like that for about 2 weeks, before I found a better way.

Quote
Keep it simple, after you are done making a shovel just click Exit ("click #contposx+30 #contposy+450" if a crafting gump on OSI). Don't forget to wait until the Gump returns after making the shovel before you move to the next one. I would also suggest eliminating #contkind.

I use a "ClickAndWait" sub which clicks where you want it to click and waits for the Gump to respond before moving on to the next line of code. Fell free to check out my standard subs in my script library, maybe it will help.

X

I use
 
Code: [Select]
click #contposx #contposy f r
to close everything with no issues, though I haven't tried it on runebooks because of their oddball #contsize

I also use #contkind and #contsize quite liberally with no issues, and on my miner I have pulled the check values out and put them in the header, so any user could readily change their values if needed.

I agree it's not the simplest approach, but it's the only way I've found to achieve the performance I want

*edit*

PEBKAC at top
« Last Edit: February 03, 2016, 05:08:33 PM by lydaan »

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +600
  • Referrals: 2
    • View Profile
Re: #contblah issues [SOLVED] - PEBKAC
« Reply #5 on: February 03, 2016, 05:45:32 PM »
0
Ah, I should have been able to figure out that was your point with the While statements :)

I typically just create the item then wait for the gump name to come back up then click exit. Well good luck either way.
X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Tags: