e3_CorpseSummoning.inc

Discussion in 'E3' started by Casai, Aug 30, 2018.

  1. Remi

    Remi Orc Pawn

    Messages:
    44
    Stalls at merchant. It seems as though it doesn't recognize that the window is open and that the merchant has the SoulStoneToUse.

    Your problem is here

    Code:
       :opendisciplewindow
       /click right target
       /delay 10 ${Window[MerchantWnd].Open}
       /if (!${Window[MerchantWnd].Open}) {
           /goto :opendisciplewindow
       }
       /varset merchantTotal -1
       /if (${merchantTotal}!=${Window[MerchantWnd].Child[ItemList].Items}) {
           /varset merchantTotal ${Window[MerchantWnd].Child[ItemList].Items}
           /delay 11
           /goto :opendisciplewindow
       }
    
    merchantTotal is set to -1, set again in the /if, then the loop makes the merchantTotal -1 again.

    Your solution is to move the /varset merchantTotal -1 to be outside of the loop / above the opendisciplewindow label.
     
    Last edited: Mar 7, 2021
  2. Casai

    Casai Orc Legionnaire

    Messages:
    109
    edited some stuff. worked well for 1 summon I tried it with
    Code:
    SUB buysoulstone
       /declare buyfailedcount int local
       /varset buyfailedcount 0
       /if (${FindItemCount[${SoulStoneToUse}]}) {
           /RETURN
       }
       :tardisciple
       /cleanup
       /delay 5
       /cleanup
       /delay 5
       /Target "A Disciple of Luclin"
       |/target ID 56
       /if (!${Target.ID}) {
           /goto :tardisciple
       }
       :opendisciplewindow
       /click right target
       /delay 10 ${Window[MerchantWnd].Open}
       /if (!${Window[MerchantWnd].Open}) {
           /goto :opendisciplewindow
       }
       /if (${Window[MerchantWnd].Child[ItemList].List[=${SoulStoneToUse},2]}) {
           /delay 22
       } else {
           /delay 11
           /goto :opendisciplewindow
           /varcalc buyfailedcount ${buyfailedcount} + 1
           /if (${buyfailedcount} > 6) {
                   /goto :tardisciple
           }
       }
       /varset buyfailedcount 0
       /nomodkey /notify MerchantWnd ItemList listselect ${Window[MerchantWnd].Child[ItemList].List[=${SoulStoneToUse},2]}
       /delay 11
       /if (!${FindItemCount[${SoulStoneToUse}]}) /notify MerchantWnd MW_Buy_Button leftmouseup
       /delay 11
       /if (!${FindItemCount[${SoulStoneToUse}]}) {
           /cleanup
           /goto :tardisciple
       } else {
       /nomodkey /notify MerchantWnd MW_Done_Button leftmouseup
       }
     
  3. Tharsis

    Tharsis Orc Legionnaire

    Messages:
    143
    There was another bug with the previous version. This sub would /declare merchantTotal with outer scope. e3's autosell sub would also declare merchantTotal but with local scope. Using the corpse summon script and later the autosell script would break autosell. The fix is to use local scope for declaration. I think this bug is still present in the newly updated version but I haven't checked in game.

    edit:
    Looks like the new version declares merchantTotal but no longer uses it. The fix is to remove the declaration altogether.
     
    Last edited: Mar 7, 2021
  4. Casai

    Casai Orc Legionnaire

    Messages:
    109
    yah I was testing if it works without it and looks like it does. just changed that portion of the script recently. I dont wipe enough to fully test this :)