Author Topic: Freddy Snippets  (Read 27988 times)

0 Members and 1 Guest are viewing this topic.

Offline bendel

  • Full Member
  • ***
  • Posts: 211
  • Activity:
    0.4%
  • Reputation Power: 4
  • bendel has no influence.
  • Respect: +33
  • Referrals: 0
    • View Profile
Re: Freddy Snippets
« Reply #30 on: May 07, 2018, 04:11:35 PM »
0
Nice one freddy!
looking forward :)

Offline freddyTopic starter

  • Sr. Member
  • *
  • Posts: 267
  • Activity:
    0.2%
  • Reputation Power: 3
  • freddy has no influence.
  • Gender: Male
  • Respect: +37
  • Referrals: 1
    • View Profile
Re: Freddy Snippets
« Reply #31 on: May 08, 2018, 09:12:55 PM »
0
I also realized the script will only use one BoS. If the bag becomes saturated the script will halt even if you have multiple BoS in your pack. This will be fixed shortly. 


   
   
My Scripts

Offline freddyTopic starter

  • Sr. Member
  • *
  • Posts: 267
  • Activity:
    0.2%
  • Reputation Power: 3
  • freddy has no influence.
  • Gender: Male
  • Respect: +37
  • Referrals: 1
    • View Profile
Re: Freddy Snippets
« Reply #32 on: May 25, 2019, 01:37:20 PM »
0
;==================================
; Script Name: Freddy's Cdeed Maker
; Author: Freddy
; Version: 1.0
; Client Tested with: 7.0.16
; EUO version tested with: 1.5 (Build 0199)
; Shard OSI
; Revision Date: 10-16-2011
; Revision Date: 10-16-2011
; Purpose: Uses a commodity deed box to fill commodity deeds with the amount of your choice
;==================================

Code: [Select]
;==================================
; Script Name: Freddy's Cdeed Maker
; Author: Freddy
; Version: 1.0
; Client Tested with: 7.0.16
; EUO version tested with: 1.5 (Build 0199)
; Shard OSI
; Revision Date: 10-16-2011
; Revision Date: 10-16-2011
; Purpose: Uses a commodity deed box to fill commodity deeds with the amount of your choice
;==================================
set %comdeed_box OQXBLSD ;The item id of your commodity deed box
set %resource_box LBDUGOD ;Item id of your container that holds the items to deed
set %deed_container PXDUGOD ;Item id of the container holding blank deeds
set %deed_storage MSIPERD ;Item id of the container to hold filled deeds. You can use #backpackid or any container in your pack
set %resource_type jjg  ;the item type of the resource to deed
set %color 2129 ; set to 0 if default. the #findcol of the resource
set %amount_to_deed 5000 ;number of items to put in the deed
set %amount_to_make 12 ;number of deeds to make
;==================================
gosub set_containers
wait 1s
for %u 1 %amount_to_make
{
event sysMessage making deed %u of %amount_to_make
gosub drag_item %resource_box %resource_type %color %amount_to_deed %comdeed_box  Finished
gosub drag_item %deed_container EWH 71 1 %comdeed_box commodity_deed
gosub deed_item
wait 10
gosub drag_item %comdeed_box EWH 1426 1 %deed_storage commodity_deed
wait 10
}
Display Finished
halt
;-------------------------------------------------------------
;-------------------------------------------------------------
sub deed_item
finditem EWH C_ , %comdeed_box
set #lobjectid #findid
event macro 17 0
target 2s
finditem %resource_type C_ , %comdeed_box
set #ltargetid #findid
event macro 22
wait 10
return
;-------------------------------------------------------------
;-------------------------------------------------------------
sub drag_item
finditem %2 C_ , %1
for #findindex 1 #findcnt
{
if #findcol = %3
{
 if #findstack < %4
 set %drag_this #findstack
 else
 set %drag_this %4
 exevent drag #findid %drag_this
 wait 10
 exevent dropc %5
 wait 10
 break
 }
  }
  if #findkind = -1
  {
   display You are out of %6
   halt
  }
return
;-------------------------------------------------------------
;-------------------------------------------------------------
sub set_containers
  finditem  %comdeed_box g_2
  if #findkind <> -1
  {
    set #lobjectid #findid
    event macro 17 0
    wait 1s
    contpos 215 0
  }
  finditem %resource_box g_2
  if #findkind <> -1
  {
    set #lobjectid #findid
    event macro 17 0
    wait 1s
    contpos 430 0
  }
  finditem %deed_container g_2
  if #findkind <> -1
  {
    set #lobjectid #findid
    event macro 17 0
    wait 1s
    contpos 645 0
  }
  finditem %deed_storage g_2
  if #findkind <> -1
  {
    set #lobjectid #findid
    event macro 17 0
    wait 1s
    contpos 860 0
  }
return


   
   
My Scripts

Offline freddyTopic starter

  • Sr. Member
  • *
  • Posts: 267
  • Activity:
    0.2%
  • Reputation Power: 3
  • freddy has no influence.
  • Gender: Male
  • Respect: +37
  • Referrals: 1
    • View Profile
Re: Freddy Snippets
« Reply #33 on: May 25, 2019, 01:46:18 PM »
0
;==================================
; Script Name: Freddy's Luna Buyer
; Author: Freddy
; Version: 1.0
; Client Tested with: 5. Something
; EUO version tested with: 1.5 (Build 0064)
; Shard: ALL
; Revision Date 11 May 2018
; Creation Date: 11/07/2011
; Uses Neo's buy subs. Thanks neo
;==================================

Luna Reg Buyer:

This script will stand in the corner of the mage shop and buy regs from the mages/alchemists while hidden. It's been updated to reflect the changes made to the bank system.

Will not work with EJ accounts (if that's still a thing)

Code: [Select]
;==================================
; Script Name: Freddy's Luna Buyer
; Author: Freddy
; Version: 1.0
; Client Tested with: 5. Something
; EUO version tested with: 1.5 (Build 0064)
; Shard: ALL
; Revision Date 11 May 2018
; Creation Date: 11/07/2011
; Uses Neo's buy subs. Thanks neo
;==================================
set %vendor ; Item ID of the mage reg vendors separated with an underscore like xxxxx_xxxxx_xxxxx_
set %item_type_buy DPF_JUF_KZF_WZF_SZF_JZF_KUF_RZF_MZF_ ;these are all the mage regs ID, you can change it to buy whatever they sell. wont work with potions or spell scrolls tho blank scrolls work just fine
set %bank_container ; item id of a container in your bank to place the regs
set %keep_hidden #true ;set to false if you don't want to hide
set %delay_between_loops 60 ;in seconds the amount of time to wait after scanning every vendor
;-----------------------Don't edit below----------------------
;-------------------------------------------------------------
set #lpc 1000
gosub separate_string %item_type_buy _
for %u 1 %t_num
{
  set %item . %u %return . %u
}
set %itemcnt %t_num
set %t_num 0
gosub separate_string %vendor _
for %u 1 %t_num
{
  set %vendor . %u %return . %u
}
set %vendcnt %t_num
set %t_num 0
event macro 3 0 bank
wait 15
set %bankid #contid
mainloop:
for %vendor_buy 1 %vendcnt
{
  wait 15
  set %vendor %vendor . %vendor_buy
  for %itm 1 %itemcnt
  {
    wait 15
    if %keep_hidden = #true
    {
      while H notin #charstatus
      {
        event macro 13 21
        wait 12s
      }
    }
    gosub get_gold
    wait 10
    while #result <> #false
    {
      set %num 999
      set %buy_this %item . %itm
      if %buy_this in wuf_dpf
      {
        set %num #maxweight - #weight
      }
      if #gold < 2
        gosub get_gold
      event property %vendor
      if alchemist in #property
        set %position 5
      else
        set %position 2
      gosub buy %vendor %buy_this %num %position
      if #result = #true
      {
sto_loop:
        finditem %bank_container *
        if #findkind = -1
        {
          event macro 3 0 bank
          wait 1s
          set #lobjectid %bank_container
          wait 10
          event macro 17 0
          wait 1s
          goto sto_loop
        }
        finditem %buy_this C_ , #backpackid
        if #findkind <> -1
        {
          wait 20
          exevent drag #findid #findstack
          wait 12
          exevent dropc %bank_container
          wait 12
        }
      }
    }
  }
}
wait %delay_between_loops , s
goto mainloop
;-------------------------------------------------------------
;-------------------------------------------------------------
sub buy
  gosub buy_books %1 %2 %3 %4
  if #result = #true
    return #true
  else
  return #false
;-------------------------------------------------------------
;-------------------------------------------------------------
sub buy_books ;neo
  namespace push
  namespace local neobuy
  set !vendor %1
  set !buy %2
  set !amount %3
  set !buyposition %4
  set !shopyes #false
  finditem !vendor G_8
  repeat
    exevent popup #findid
    gosub gumpwait normal_gump null
    wait 5
    set !x #contposx + 30
    set !y #contposy + ( 20 * !buyposition )
    click !x !y f dmc
    gosub gumpwait bill_gump null
  until #result
  set !item_x #CONTPOSX + 11
  set !item_y #CONTPOSY - 150
  set !next_x #CONTPOSX + 71
  set !next_y #CONTPOSY - 15
  set !accept_x #CONTPOSX + 42
  set !accept_y #CONTPOSY + 205
  getshopinfo
  wait 5
  for !i 1 #shopcnt
  {
    getshopinfo
    set !shopid #shopitemid
    if #shopitemtype in !buy
    {
      set !shopyes #true
      for %x 1 3
        click !item_x !item_y f dmc
      getshopinfo
      wait 10
      if #shopItemMax < !amount
      {
        set !amount #shopItemMax
      }
      setShopItem #shopitemid !amount
      break
    }
    set %timer3 #scnt + 5
    repeat
      if #scnt > %timer3
        return #false
      click !next_x !next_y f dmc
      getshopinfo
      if #shopcnt = 0
        return #false
    until #shopitemid <> !shopid || !i = #shopcnt
  }
  click !accept_x !accept_y f dmc
  wait 20
  if !shopyes <> #true
    set #result #false
  if !shopyes
    set #result #true
  namespace pop
return #result
;-------------------------------------------------------------
;-------------------------------------------------------------
sub get_gold
  return
gloop:
  if #gold <= 4999
  {
    finditem POF C_ , %bankid
    for #findindex 1 #findcnt
    {
      if #findstack > 5000
      {
        set %get 5000 - #gold
        exevent drag #findid %get
        wait 12
        exevent dropc #backpackid
        wait 12
        return
      }
    }
    if #gold < 2000
    {
      finditem EWH C_ , %bankid
      if #findkind <> -1
      {
        for #findindex 1 #findcnt
        {
          event property #findid
          str len #property
          if #findcol = 52 && #strres >= 52
          {
            set #lobjectid #findid
            wait 10
            event macro 17 0
            wait 30
            goto gloop
          }
        }
      }
    }
    if #gold < 2000
    {
      set %get 5000 - #gold
      event macro 3 0 withdraw %get
      wait 15
    }
    if #gold < 2000
    {
      display You don't have any gold!
      halt
    }
  }
return
;----------------------------------------------------------------------
;----------------------------------------------------------------------
sub separate_string
  set %t_num 0
  str Count %1 %2
  for %i 1 #strres
  {
    set %var %2
    str len %1
    set %length #strres
    str pos %1 %var
    set %del #strres - 1
    str left %1 %del %length
    set %return . %i #strres
    set %del1 %del + 1
    str del %1 1 %del1
    set %1 #strres
    set %t_num %t_num + 1
  }
return
;----------------------------------------------------------------------
;----------------------------------------------------------------------
;======= Gumpwait Sub ======= ;neo
sub gumpwait
  namespace push
  namespace local gumpwait
  set !contname %1
  set !contsize %2
  set !timeout #SCNT + 5
  if !contsize = null
  {
    repeat
    until #contname = !contname || #scnt >= !timeout
    {
      if #contname = !contname
      {
        namespace pop
        return #true
      }
      namespace pop
      return #false
    }
  }
  repeat
  until ( #contname = !contname && #contsize = !contsize ) || #scnt >= !timeout
  if #contname = !contname && #contsize = !contsize
  {
    namespace pop
    return #true
  }
  namespace pop
return #false
;======= End Sub =======






   
   
My Scripts

Tags: