Author Topic: Need Help with an EUO Insurance Script that will work with another script runing  (Read 8699 times)

0 Members and 1 Guest are viewing this topic.

Offline Dan123The123ManTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Activity:
    0%
  • Reputation Power: 1
  • Dan123The123Man has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
I am in need of an insurance script that will work either in the background of another script I have or work itself into the other script I have. I think its against the rules though to ask to modify a script that another member created so I won't post the script unless I have permission there to do so. The insurance script I need it to scan the backpack when an item drops in it I need the script to automatically insure the item. Its the blackthorn artifacts that drop in your pack that i'd like it to insure.

I think TrailMyx was onto something though in his Artifact Monitor with Insuring, but I dont know if Valen that post in the thread got it to work or not: http://www.scriptuo.com/index.php?topic=1906.30
« Last Edit: February 03, 2016, 01:11:24 PM by Dan123The123Man »

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
first I will use the KISS

if you want to scan for item that have name you can this like.

Code: [Select]
Sub Scan
finditem * C_ , #BACKPACKID
  if #Findcnt > 0    ; this will make it loop to scan all items
  {
  For #Findindex 1 #Findcnt    ;  this will set the amount to items to look for.
  {
    Event Property #Findid  ;  this will read items name
           if ( Legendary in #Property )
            {
            set %Item #Findid   ;   This will safe the ID of the items.
              }
   }
}
return

Now you need to find a sub that will insure items.

Code: [Select]
Sub Insure
set %insure %item
finditem %insure  C_ , #BACKPACKID

insert the part to insure.

return

Offline Dan123The123ManTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Activity:
    0%
  • Reputation Power: 1
  • Dan123The123Man has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
wait im like an idiot Ghost.. The first part of the script there you said was the KISS? Is the insurance second part of the script the insure sub like the HUG and the main script to kill the monsters that will be after the insurance sub the having sex part? Im an idiot man im sorry I mean im serious though are there 3 parts to this? Like the scan part at the beginning, then the insure part will be the middle and I could like add the script to the bottom part and it will work that way? God I know i sound stupid.

Offline lydaan

  • Jr. Member
  • **
  • Posts: 70
  • Activity:
    0%
  • Reputation Power: 3
  • lydaan has no influence.
  • Respect: +6
  • Referrals: 0
    • View Profile
The Ghost got it mostly right, but I'm going to rewrite the sub the way I would do it:

Code: [Select]
sub auto_insure
   set !lpc #lpc  
   set #lpc 1
   finditem  * c_ , #backpackid
   set #lpc 10
   for #findindex 1 #findcnt
   {
      if #findtype notin ckf_twf_ ;add more things to this that do not need to be insured, and are in your backpack... ckf is for bag types. twf is for shovels, etc, etc...
      {
         wait 10   <--- this is so #property updates, may need to raise it, I wouldn't go lower than 10
         event property #findid
         if legendary in #property && insured notin #property <--- chage this or add more like: || blahblahblah in #property && insured notin #property
         {
            exevent popup #charid
            click x y ;---need to figure out where the x and y coords are for toggle item insurance on your shard
            wait 10
            set #ltargetid #findid
            set #ltargetkind 1
            target
            event macro 22 0
            key esc
         }
      }
   }
   set #lpc !lpc
return

#property is a PITA. I've just hashed this out while working on my BOD Filler. The above SHOULD work, but it will be relatively slow, as wait 10 = 500ms or .5 seconds, and is passed everytime something is scanned in your backpack (for every item). I've encapsulated the function in an if notin statement, adding more things like runebooks, spellbooks. etc to the not to be insured list will make it waaay faster.

Hope this helps, I'll check in later.

- Lydaan

*edit*

LMAO  :D :D :D

KISS = Keep It Simple Stupid
« Last Edit: February 03, 2016, 04:00:55 PM by lydaan »

Offline Dan123The123ManTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Activity:
    0%
  • Reputation Power: 1
  • Dan123The123Man has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Thanks alot The Ghost and Lydaan for taking the time to help me. I gotta goto sleep to get ready for work tonight but tomorrow when I get home i'll test it out to see if I can get it to work. I also sent you a PM lydaan. I think the sub would just go at the bottom of the script and then where it says:

gosub GetSkillInfo
gosub auto_insure   <--- (or maybe make it the first "gosub" on the list?)
gosub showEUOMenu1
gosub initialStart
gosub Targeting

I could just add the sub like after the first one there and as long as the actual script is at the bottom of the killing script I have it should work I guess, right?
« Last Edit: February 03, 2016, 05:12:12 PM by Dan123The123Man »

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
That will not work because this is the main loop

this is where you need it.   You can also add a time to it on scan every 10 min.
Code: [Select]
While %Scotch_Tape > %Chuck_Norris
{
If %CastNF = Yes
 gosub CastNF
If %CastEV = Yes
  gosub castEV %targetX %targetY %targetZ 57
gosub HideSelf
gosub MenuUpdate
gosub auto_insure   <--- (or maybe make it the first "gosub" on the list?) 
}

Offline Dan123The123ManTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Activity:
    0%
  • Reputation Power: 1
  • Dan123The123Man has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
The Ghost got it mostly right, but I'm going to rewrite the sub the way I would do it:

Code: [Select]
sub auto_insure
   set !lpc #lpc  
   set #lpc 1
   finditem  * c_ , #backpackid
   set #lpc 10
   for #findindex 1 #findcnt
   {
      if #findtype notin ckf_twf_ ;add more things to this that do not need to be insured, and are in your backpack... ckf is for bag types. twf is for shovels, etc, etc...
      {
         wait 10   <--- this is so #property updates, may need to raise it, I wouldn't go lower than 10
         event property #findid
         if legendary in #property && insured notin #property <--- chage this or add more like: || blahblahblah in #property && insured notin #property
         {
            exevent popup #charid
            click x y ;---need to figure out where the x and y coords are for toggle item insurance on your shard
            wait 10
            set #ltargetid #findid
            set #ltargetkind 1
            target
            event macro 22 0
            key esc
         }
      }
   }
   set #lpc !lpc
return

#property is a PITA. I've just hashed this out while working on my BOD Filler. The above SHOULD work, but it will be relatively slow, as wait 10 = 500ms or .5 seconds, and is passed everytime something is scanned in your backpack (for every item). I've encapsulated the function in an if notin statement, adding more things like runebooks, spellbooks. etc to the not to be insured list will make it waaay faster.

Hope this helps, I'll check in later.

- Lydaan

*edit*

LMAO  :D :D :D

KISS = Keep It Simple Stupid


See you can see in the screenshot below that the artifact falls into the characters pack and that is the message that pops up, but he does not insure it using the Insure Sub in the script. Even though I put these lines in the script:

        if Durability in #property && insured notin #property <--- chage this or add more
        if Minax in #property && insured notin #property
        if Blackthorn in #property && insured notin #property
        if legendary in #property && insured notin #property <--- chage this or add more
        if minor magic item in #property && insured notin #property <--- chage this or add more
        if lesser in #property && insured notin #property <--- chage this or add more
        if greater in #property && insured notin #property <--- chage this or add more

Even when it was just "if Minor" and not "If minor magic item" it still did not try to insure it. As soon as the artifacts started droppign in the characters pack the Insure Sub just stopped working all together. Everything else worked, like he cast EVs in same spot but he still cast them, he healed and cured but the insure sub just stopped working after they started falling in his pack. Also that Insure Sub is with a wait 50 and the second wait was 30. So I upped it from 10 to 50 then up from 10 to 30 to give it more then enough time, and no im not lagging.





EDIT: Just tested something interesting... When I opened the Insure menu and manually checked the box next to each item and then clicked Ok... The Insure Sub started working except it UN Insured both items and left them both UN Insured. Did not try to Re Insure them.
« Last Edit: February 05, 2016, 12:21:04 PM by Dan123The123Man »

Offline lydaan

  • Jr. Member
  • **
  • Posts: 70
  • Activity:
    0%
  • Reputation Power: 3
  • lydaan has no influence.
  • Respect: +6
  • Referrals: 0
    • View Profile
so, before anything dies and before you loot anything, try adding

Code: [Select]
set %checkweight #weight
then, wherever the stuff spawns in your bag, that's where the gosub auto_insure needs to be, and put this if around it:
Code: [Select]
if #weight > %checkweight
{
sub auto_iinsure
...
return
}

I also made a mistake in the inner most if statement, it should be:

Code: [Select]
            exevent popup #charid
            wait 10 <---- this should be here, to give the context menu time to pop
            click x y
            set #ltargetid #findid
            set #ltargetkind 1
            target
            event macro 22 0
            key esc

this may fix the issue, but I don't know...

PLEASE POST YOUR FIXES!!!! ANY AND ALL ITERAIONS!!! IT IS IMPOSSIBLE FOR ME TO KNOW WHAT ISN'T WORKING WIHOUT SEEING THE LOGIC!!!!

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Lyaan

He add his scan set up this way
Code: [Select]
event property #findid
         if legendary in #property && insured notin #property <--- chage this or add more like: || blahblahblah in #property && insured notin #property
         if Minax in #property && insured notin #property
         if Blackthorn in #property && insured notin #property
 
This is the new sub I send him

I send him this
Code: [Select]
sub auto_insure
   set !lpc #lpc
   set #lpc 1
   finditem  * c_ , #backpackid
   set #lpc 10
   for #findindex 1 #findcnt
   {
      if #findtype notin ckf_twf_spn_yxm_mpf_xxm ; add more things to this that do not need to be insured, and are in your backpack... ckf is for bag types. twf is for shovels, etc, etc...
      {
         wait 20 ;   <--- this is so #property updates, may need to raise it, I wouldn't go lower than 10
         event property #findid
         if ( Minax in #property && insured notin #property || Blackthorn in #property && insured notin #property } ; <--- change this or add more like:
          {
            exevent popup #charid
            click 73 130 ;  ---need to figure out where the x and y coords are for toggle item insurance on your shard
            wait 10
            set #ltargetid #findid
            set #ltargetkind 1
            target
            event macro 22 0
            key esc
         }
      }
   }
   set #lpc !lpc
   set %insuretimer #SCNT + 180  ; ( 180 sec )   < ---  add in sec the time you want between each scan
return

Offline lydaan

  • Jr. Member
  • **
  • Posts: 70
  • Activity:
    0%
  • Reputation Power: 3
  • lydaan has no influence.
  • Respect: +6
  • Referrals: 0
    • View Profile
Thanks Ghost, that's what it sounded like was going on

*edit*

make sure to fix that wait placement, because that may be part of the problem
« Last Edit: February 05, 2016, 01:41:51 PM by lydaan »

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
This is what I use to insure items when need

Code: [Select]
;====================== Manual setting =======================
set %insuretimer #SCNT
; -------------------  End Manual Setting ---------------

; =============== The Ghost Insure Sub ======================
sub ScanInsure
   finditem  * c_ , #backpackid
   for #findindex 1 #findcnt
   {
       if #Findcol = 1157  ;    ; 2301 = Doom   1157 = Minax
      {
         Event sysmessage Looking for Items
         event property #findid
           if ( Minax in #property && insured notin #property || doom in #property && insured notin #property )
               gosub InsureItem
            Else
                Ignoreitem #Findid 7
   }
   }
  set %insuretimer #SCNT + 180  ; ( 180 sec )   < ---  add in sec the time you want between each scan
return

sub InsureItem
exevent popup #charid
wait 10
click 75 130 ;  ---  Location of Toggle Item Insurance
set #ltargetid #findid
set #ltargetkind 1
target
event macro 22 0
wait 10   ; this is to let time to remove cursor
key esc
return
; ------------------------------------------------------------

Offline lydaan

  • Jr. Member
  • **
  • Posts: 70
  • Activity:
    0%
  • Reputation Power: 3
  • lydaan has no influence.
  • Respect: +6
  • Referrals: 0
    • View Profile
ah yes... I bet that wait before key esc was an issue with mine... nice work

insted of wait 10, I would use target... will pass as soon as cursor turns into target
« Last Edit: February 06, 2016, 03:46:54 PM by lydaan »

Tags: