Author Topic: Need some advice w/ this script!  (Read 2289 times)

0 Members and 1 Guest are viewing this topic.

Offline razeialTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Activity:
    0%
  • Reputation Power: 1
  • razeial has no influence.
  • Respect: +2
  • Referrals: 0
    • View Profile
Need some advice w/ this script!
« on: July 18, 2012, 04:31:36 PM »
0
Ok guys, I'm using Guadah's Multiskill trainer to train up Bushido. What I also want is a script to scan my journal for a weapon break, and then rearm the last type of weapon so will this script do that while guadah's script runs?

Code: [Select]
set %weapontype YSF

scanjournal 1
if weapon_has_been_destroyed in #journal
{
gosub RearmWep
}
goto Mainloop


Sub RearmWep
SET  #lobjecttype %weapontype
FINDITEM %weapontype C_ , %backpackid
      IF #FINDKIND = -1
      {
      HALT
      }
   SET #RHANDID #findid
   WAIT %ShortDelay
   event macro 24 2
   WAIT 1s
return
« Last Edit: July 18, 2012, 04:40:29 PM by razeial »

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Need some advice w/ this script!
« Reply #1 on: July 18, 2012, 05:07:20 PM »
0
Oh my.... perhaps this could help you out. Of course you'll have to make a couple changes for ID's and which hand the item is in....

Code: [Select]
set %throwing FID_THY_YND_NND_ ; id types of the weapon

repeat
finditem %throwing C_ , #charID
if #findCnt < 1
  gosub equip
wait 1
until #false

sub equip
finditem %throwing C_ , #backpackID
  {
  if #findCnt < 1 ; oops, none in the backpack
  halt
  }
set #rhandid #findid
event macro 24 2
wait 10
return

You could use a finditem and a specific ID then have hotkeys to set the specific weapon/spellbook you want armed. Easy to fast switch it this way.

To make it a sub routine just change this part:

sub CervsWeaponSwapORama
finditem %throwing C_ , #charID
if #findCnt < 1
  gosub equip
wait 1
return

And of course put this somewhere in your mainloop:

gosub CervsWeaponSwapORama
« Last Edit: July 18, 2012, 05:25:46 PM by Cerveza »
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline razeialTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Activity:
    0%
  • Reputation Power: 1
  • razeial has no influence.
  • Respect: +2
  • Referrals: 0
    • View Profile
Re: Need some advice w/ this script!
« Reply #2 on: July 18, 2012, 06:18:38 PM »
0
So........something like this??!?!?


Code: [Select]
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
; MAIN LOOP
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

set %weapon YSF_ ; id types of the weapon


Gosub CervsWeaponSwapORama
scanjournal 1
if is_destroyed_by_the_attack in #journal
{
gosub equip
}
repeat
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; SUBS
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
sub CervsWeaponSwapORama
finditem %weapon C_ , #charID
if #findCnt < 1
  gosub cervequip
wait 1
until #false
if #false
   {
    display You are out of Weapons!
    halt
   }

sub equip
finditem %throwing C_ , #backpackID
  {
  if #findCnt < 1 ; oops, none in the backpack
  halt
  }
set #rhandid #findid
event macro 24 2
wait 10
return

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Re: Need some advice w/ this script!
« Reply #3 on: July 18, 2012, 07:18:16 PM »
0
I think you misunderstood Cerv...

In his method, you're scanning your paperdoll to look for whatever weapon type. If it doesn't find it on the paperdoll (meaning it broke) it goes into the subroutine to equip a new one. No need to scan the journal at all (which is good, because journal scanning can be QUITE messy and not reliable)

The only edit you'll need to make to Cerv's script is to change the first line to whatever weapon types you need:
Code: [Select]
set %throwing FID_THY_YND_NND_ ; id types of the weaponChange to:
Code: [Select]
set %throwing YSF_ ; id types of the weapon
(Disregard the fact that his variable is called "%throwing", you could simply change all occurrences of that variable in the script to "%weapontypes")

As he said, you may also need to change which hand is being equipped ("event macro 24 2" versus "event macro 24 1") and use #lhandid instead of #rhandid, but that's dependent on which hand the weapon is getting equipped into.

So your final script might look like:

Code: [Select]
set %weapontypes YSF_ ; id types of the weapon

repeat
finditem %weapontypes C_ , #charID
if #findCnt < 1
  gosub equip
wait 1
until #false

sub equip
finditem %weapontypes C_ , #backpackID
  {
  if #findCnt < 1 ; oops, none in the backpack
  halt
  }
set #rhandid #findid
event macro 24 2
wait 10
return
« Last Edit: July 18, 2012, 07:21:37 PM by UOMaddog »
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Tags: