Author Topic: Wanted to contribute what little I can: Bone cutting Snippet  (Read 2036 times)

0 Members and 1 Guest are viewing this topic.

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
0
Hail!

I've been using so much content from this forum that I wanted to contribute what little I can.

Several looting scripts out there gather all sorts of resources, but I couldn't find one that also cut up bones.  I liberally stole from others' code to create a bonecutting subroutine that worked for me.  Feel free to incorporate it or suggest changes.  It's rather mechanical and not particularly elegant, but it's been working for the last 3567 bones...

Set up your bone and scissor types.  These will also have to be added to you list of item types to loot.  Replace XXXXXXXX with the item id of your scissors:
Code: [Select]
set %cuttypes EEG_GED_OJK_XIK_SJK_IJK_TJK_BJK_UJK_DJK_MJK_AJK_LJK_FJK_RJK_EJK_ZIK_YIK_JJK_GJK_KJK_HJK_DEG
set %scissortypes KAG_JAG
set %scissors XXXXXXXX

Set up your sub cut_bones:
Code: [Select]
sub cut_bones
finditem %cuttypes C_ , #backpackid
if #findkind <> -1
{
  set %_findid #findid
  set #ltargetid %_findid
  set #lTargetKind 1
  set #lobjectid %scissors
  wait 5
  event macro 17 0
  target 5s
  event macro 22 0
  wait 9
}
return

This assumes you already have a variable set up for #backpackid.  If not, you can just substitute your character's value for this variable name.  You will also have to add type GUF to your loot list to move the cut bones to your drop-off container.

In the script I'm editing, I inserted the gosub command just before my weight check. 

Again, this is a pitiful contribution and is a hash of code I pulled from other scripts to turn into a stand alone subroutine.  Maybe it will help someone else learn like I'm learning.

Cheers.

 :)

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Wanted to contribute what little I can: Bone cutting Snippet
« Reply #1 on: May 10, 2009, 07:19:24 AM »
0
Just a few slight improvements to the code.  Autodetect of scissors and not running cut routine if no scissors found, and replacement of #Findkind with #findCnt (= find Count ie number of items found) and direct setting of #targetid instead of the extra line you had.

Code: [Select]
set %cuttypes EEG_GED_OJK_XIK_SJK_IJK_TJK_BJK_UJK_DJK_MJK_AJK_LJK_FJK_RJK_EJK_ZIK_YIK_JJK_GJK_KJK_HJK_DEG
set %scissortypes KAG_JAG
set %scissors N/A

; ~~~~~~~~~~~
Sub SetScissors
  set %scissors N/A
  Finditem %ScissorTypes C_ , #Backpackid
  IF #Findcnt >= 1
     set %Scissors #Findid
Return

sub cut_bones
  If %Scissors = N/A
     Gosub SetScissors
  If %Scissors = N/A
     Return
  finditem %cuttypes C_ , #backpackid
  if #findcnt >= 1
     {
     set #ltargetid #findid
     set #lTargetKind 1
     set #lobjectid %scissors
     wait 5
     event macro 17 0
     target 5s
     event macro 22 0
     wait 9
     }
return
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Wanted to contribute what little I can: Bone cutting Snippet
« Reply #2 on: May 10, 2009, 07:33:34 AM »
0
Nice!  Didn't think of that, thanks!

 :D

Tags: