Alaskan's Lazy Depositor

Discussion about the technical aspects of scripting. Ask about all issues involving your freelance projects here.
Locked
Alaskan
Expert Scribe
Posts: 36
Joined: Sun Jul 14, 2013 2:08 pm
Location: Trinsic Bank

Alaskan's Lazy Depositor

Post by Alaskan »

A simple deposit script for EUO that will deposit all gold and checks from the loot "bag/bags" (currently only supports two) into any exex box in town or your house. This is a rough draft so any suggestions on how to make it more efficient or add multiple bags is more than welcome. Hope you guys enjoy and if you find any problems with it please send me a message on here so I can take a look. Thanks in advance and happy hunting 8) .

Code: Select all

;=================================================================
; Script Name: Alaskan's Lazy Depositor
; Author: Alaskan
; Version: 1.2
; Shard OSI / FS: OSI / FS OK
; Revision Date: 07/02/2014
; Purpose: Empties all gold and checks from the bag/bags you specify as your loot bags
;(maximum of two) into any exex box.
;
;Suggestions or issues message Alaskan on the UOEX forums.
;=================================================================
set %loot POF_EWH
set %exex CUD_HKF
set #lpc 100
display yesno Do you have more then one loot bag?
if #dispres = yes
{
  display ok If one of your loot bags is your backpack then target your backpack on your paperdoll now.
  set #targcurs 1
  while #targcurs = 1
    wait 1
  set %bag1 #ltargetid
  set #ltargetkind 1
selectbag:
  display ok Select your second loot bag.
  set #targcurs 1
  while #targcurs = 1
    wait 1
  set %bag2 #ltargetid
  set #ltargetkind 1
  if %bag1 =  %bag2 || %bag2 = #backpackid
  {
    display ok You must select a differnt loot bag.
    goto selectbag
  }
  gosub twobags
}

display ok If your loot bag is you backpack then target your backpack on your paperdoll.
set #targcurs 1
while #targcurs = 1
  wait 1
set %lootbag #ltargetid
set #ltargetkind 1
gosub onebag

sub onebag
main:
  finditem %exex G_5
  if #findcnt > 1
  {
    for #findindex 1 #findcnt
    {
      event property #findid
      if exex notin #property
      {
        ignoreitem #findid
        goto main
      }
    }
  }
  else
  {
    if #findcnt > 0
    {
      event property #findid
      if exex in #property
      {
        set %exextemp #findid
        for %msg 1 3
        {
          event exmsg #findid 4 7 Take a load off :)
          wait 10
        }
        while #finddist > 2
        {
          wait 1
          if #finddist > 5
            goto main
        }
      }
      else
        goto main
      if %lootbag = #backpackid
        gosub backpack
      else
      {
        finditem %lootbag c_ , #backpackid
        set #lobjectid #findid
        set #nextcposx 607
        set #nextcposy 426
        event macro 17 0
        wait 10
        repeat
          {
            finditem %loot c_ , %lootbag
            if #findcnt > 0
            {
              exevent drag #findid #findstack
              wait 10
              exevent dropc %exextemp
              wait 10
            }
          }
        until #findcnt < 1
      }
      finditem %exextemp G_5
      while #finddist < 5
        wait 1
      event macro 4 4 [exex
      while #contsize <> 580_530
        wait 1
      gosub OffsetClick 76 378
      while #contsize <> 580_530
        wait 1
      contpos 12 39
      wait 5s
      gosub OffsetClickClose 330 428
      goto main
    }
    else
      goto main
  }
  goto main
return

sub twobags
main2:
  finditem %exex G_5
  if #findcnt > 1
  {
    for #findindex 1 #findcnt
    {
      event property #findid
      if exex notin #property
      {
        ignoreitem #findid
        goto main2
      }
    }
  }
  else
  {
    if #findcnt > 0
    {
      event property #findid
      if exex in #property
      {
        set %exextemp #findid
        for %msg 1 3
        {
          event exmsg #findid 4 7 Take a load off :)
          wait 10
        }
        while #finddist > 2
        {
          wait 1
          if #finddist > 5
            goto main2
        }
        if %bag1 = #backpackid
          gosub backpack
        else
        {
          finditem %bag1 c_ , #backpackid
          set #lobjectid #findid
          set #nextcposx 614
          set #nextcposy 440
          event macro 17 0
          wait 10
          repeat
            {
              finditem %loot c_ , %bag1
              if #findcnt > 0
              {
                exevent drag #findid #findstack
                wait 10
                exevent dropc %exextemp
                wait 10
              }
            }
          until #findcnt < 1
          finditem %bag2 c_ , #backpackid
          set #lobjectid #findid
          set #nextcposx 605
          set #nextcposy 214
          event macro 17 0
          wait 10
          repeat
            {
              finditem %loot c_ , %bag2
              if #findcnt > 0
              {
                exevent drag #findid #findstack
                wait 10
                exevent dropc %exextemp
                wait 10
              }
            }
          until #findcnt < 1
        }
        finditem %exextemp G_5
        while #finddist < 5
          wait 1
        event macro 4 4 [exex
        while #contsize <> 580_530
          wait 1
        gosub OffsetClick 76 378
        while #contsize <> 580_530
          wait 1
        contpos 12 39
        wait 5s
        gosub OffsetClickClose 330 428
        goto main2
      }
    }
    else
      goto main2
  }
  else
    goto main2
}
goto main2
return


sub OffsetClick
set %tempx %1 + #CONTPOSX
set %tempy %2 + #CONTPOSY
click %tempx %tempy f
return

sub OffsetClickClose
set %tempx %1 + #CONTPOSX
set %tempy %2 + #CONTPOSY
click %tempx %tempy r
return

sub backpack
set #nextcposx 839
set #nextcposy 527
event macro 8 7
wait 10
repeat
  {
    finditem %loot c_ , #backpackid
    if #findcnt > 0
    {
      exevent drag #findid #findstack
      wait 10
      exevent dropc %exextemp
      wait 10
    }
  }
until #findcnt < 1
return
Last edited by Alaskan on Fri Jul 04, 2014 1:00 am, edited 1 time in total.
Alaskan
Expert Scribe
Posts: 36
Joined: Sun Jul 14, 2013 2:08 pm
Location: Trinsic Bank

Re: Alaskan's Lazy Depositor

Post by Alaskan »

I'm aware of certain bugs with this script and I'm currently editing it. My new one will have a menu for you to select what you will want to deposit and hopefully I can get the multiple bag issue fixed. Look forward to it :)
Alaskan
Expert Scribe
Posts: 36
Joined: Sun Jul 14, 2013 2:08 pm
Location: Trinsic Bank

Re: Alaskan's Lazy Depositor

Post by Alaskan »

The issue of selecting two bags are fixed. Be on the look out for my last and final revision which will contain a menu along with a bunch of other options as to what you will want to deposit along with a save option that way all you'll have to do is just run the script instead of setting it up each time you run it :D .
Locked