Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - krustenkrabbe

Pages: [1]
1
Submit your Script / SupplyShopper: Buys Regs, Scrolls and Bottles
« on: July 13, 2012, 04:46:48 AM »
I created this script to automate the purchasing of reagents, scrolls and bottles.

This script does not yet have a menu and may have a lot of room for improvements and bugfixing, but I would like to post it here since I couldn't find anything like it here or on the EasyUO site.

I'd welcome feedback for this script!

2
Script Debug / Need help with saving and reloading a *variable
« on: July 10, 2012, 06:38:01 AM »
So, this is probably a pretty basic task for you scripters, but I can't seem to get it done.
I've modified the TerMur Lumberjack so that it cycles through banks to drop off and to have it use a beetle and I'd like to post that modification in the proper thread but.... I hardcoded all the click-locations in the script for me and now want to do it with a setup.

Here is what I mean:
Code: [Select]
set %rune 1
set %tree 1
set *x . #charid . %rune . %tree 1234
msg *x . #charid . %rune . %tree

So I'd like it to message "1234" but it doesn't....

Thanks for your help, I'm really desperate about that one, I'm toying around with it for like 2 weeks now and can't seem to find a solution.

3
Submit your Script / My first Script: Sampire Hunting Assistance
« on: May 28, 2012, 11:25:02 AM »
So this is my first script, I wanted to get some assistance in hunting with my sampire.
I tried out Galeans Sampire Hunter, but it didn't work exactly as I wanted so I took his code to look for enemies, attack them and honor them and then built my own script around it.

I'll try to get it more customizable in the future, but so far it's working good for me.
The comments in the code pretty much explain everything, I hope you can use it=)

Code: [Select]
;***************************************************************************
;** Sampire Hunter Script                                                 **
;** Will do the following:                                                **
;** Search for any specified monsters in range, attacks and               **
;** honors them automatically. Uses Lightning Strike, Armor Ignore        **
;** and Consecrate Weapon during fights. The script will prefer           **
;** Armor Ignore over Lightning Strike. If the enemy is dead or           **
;** lost, will search for new enemies and repeat.                         **
;** This script will use Greater Strength, Agility and Heal potions       **
;** if desired and necessary. It will not Disarm for using potions, so    **
;** better fight with a one-handed weapon.                                **
;** Date: 28.05.2012                                                      **
;** Version 1                                                             **
;***************************************************************************

;User defined variables.
sub setup_variables
set %Consecrate_Weapon_Duration 8                                           ;Bufftime IN SECONDS for Consecrate Weapon
set %creature EJ_DD_DB_VGB_ED_NG_IG_ZF_DN_TC_CO                                   ;Set %creature to the type of creatures you wish to auto attack
set %combatrange 6                                                          ;Range in tiles to honor and attack enemies
set %duration_agility_pots 120                                              ;Duration for Agility Potion effect length IN SECONDS.
set %duration_strength_pots 120                                             ;Duration for Strength Potion effect length IN SECONDS.
set %duration_heal_pots 10                                                  ;Cooldown time between using Heal Potions IN SECONDS.
set %hitpoints_potion_heal 60                                               ;Hitpoints at which healing with potions will be used.
set %mana_ls 7                                                              ;Minimum mana for using Lightning Strike.
set %mana_ai 40                                                             ;Minimum mana for using Armor Ignore.
set %mana_cw 10                                                             ;Minimum mana for using Consecrate Weapon.
set %agility_type YUF                                                       ;Type of Greater Agility Potion.
set %strength_type XUF                                                      ;Type of Greater Strength Potion.
set %heal_type UUF                                                          ;Type of Greater Heal Potion.
set %wait_potions 15                                                        ;Delay for handling with the potion use code. (Wait time between setting potion as last object and drinking it)
set %wait_special_move 2                                                    ;Delay after executing special weapon moves (seems to be a lag issue).
set %delay_cw 20                                                            ;Delay after casting Consecrate Weapon.
;Note: Only uses potions in open containers (like bag in backpack).
;Note: One hand must be free to drink potions, script will not disarm or check for need to disarm.
return
;Checks if setup has been done already, will do if not.
if %setup_done <> 1
 {
  gosub setup
 }


;Checks for enemies in range. If an enemy is found it attacks, honors and goes to the attack sub which does the actual fighting.
for %range 1 %combatrange
 {
  finditem %creature G_ , %range
  if #findkind <> -1
   {
    set #ltargetid #findid
    set #ltargetkind 1
    set %enemy #findid
    wait 1
    event macro 49 1
    target 3s
    event macro 22
    event macro 27
    gosub attack
   }
 }
set %range 0 ;Resets range to search for enemies.

;This sub does the actual fighting.
sub attack
;Sets duration since last cast of CW spell.
set %dauer_cw #time - %casttime_cw
;Casts CW when time since last cast is greater than specified at the beginning in the
;variables.
if %dauer_cw > %Consecrate_Weapon_Duration
 {
  if #mana > %mana_cw
   {
    event macro 15 203
    set %casttime_cw #time
    wait %delay_cw
   }
 }
;Checks if Lightning Strike is active, will activate if necessary.
;Will switch to Armor Ignore if enough mana is available.
cmpPix 1 t
 {
  if #mana > %mana_ls
   {
    if #mana <= %mana_ai
     {
      EVENT MACRO 15 149
      %wait_special_move
     }
   }
 }
;Checks if Armor Ignore is active, will activate if necessary.
cmpPix 2 t
 {
  if #mana > %mana_ai
   {
    event macro 36 0
    %wait_special_move
   }
 }
;Checks for use of Greater Agility Potion.
;Will drink a potion if necessary.
if %use_agility_potions = 1
 {
  set %dauer_agility #time - %timer_agility
  if %dauer_agility > %duration_agility_pots
   {
    finditem %agility_type C
    if findkind <> -1
     {
      set %potion #findid
      set #lobjectid %potion
      wait %wait_potions
      event macro 17 0
      set %timer_agility #time
     }
   }
 }
;Checks for use of Greater Strength Potion.
;Will drink a potion if necessary.
if %use_strength_potions = 1
 {
  set %dauer_strength #time - %timer_strength
  if %dauer_strength > %duration_strength_pots
   {
    finditem %strength_type C
     if findkind <> -1
      {
       set %potion #findid
       set #lobjectid %potion
       wait %wait_potions
       event macro 17 0
       set %timer_strength #time
      }
    }
  }
;Checks for use of Greater Heal Potion.
;Will drink a potion if necessary.
if %use_heal_potions = 1
 {
  if #hits < %hitpoints_potion_heal
   {
    set %dauer_heal #time - %timer_heal
    if %dauer_heal > %duration_heal_pots
     {
      finditem %heal_type C
      if findkind <> -1
       {
        set %potion #findid
        set #lobjectid %potion
        wait %wait_potions
        event macro 17 0
        set %timer_heal #time
       }
     }
   }
 }
;Checks if enemy is still alive. If yes, continues attacking.
;If not, script will end attack sub and look for other enemies.
finditem %enemy G_
if #findkind = 1
 {
  gosub attack
 }
return
;This sub sets the script up, asking the user to specify the features.
sub setup
    ;Calls the setup_variables sub to get the user defined variables.
    gosub setup_variables
    ;Code to setup the pixel coordinates for the Lightning Strike and Armor Ignore buttons.
    ;Saves the Pixel as number 1 for LS and number 2 for AI. Abilities must be NOT ACTIVE:
    display Move the mouse to the Lightning Strike button. LS must be inactive. You have 3 seconds
    wait 3s
    savePix #CURSORX #CURSORY 1
    display Move the mouse to the Armor Ignore button. AI must be inactive. You have 3 seconds
    wait 3s
    savePix #CURSORX #CURSORY 2
    ;Sets the timer for Consecrate Weapon for startup.
    set %casttime_cw #time - %Consecrate_Weapon_Duration
    ;Asks if Greater Agility Potions will be used.
    display yesno Do you want to use Greater Agility Potions?
    if #dispres = yes
    {
    set %use_agility_potions 1
    set %timer_agility #time - %duration_agility_pots
    }
    ;Asks if Greater Strength Potions will be used.
    display yesno Do you want to use Greater Strength Potions?
    if #dispres = yes
    {
    set %use_strength_potions 1
    set %timer_strength #time - %duration_strength_pots
    }
    ;Asks if Greater Heal Potions will be used.
    display yesno Do you want to use Greater Heal Potions?
    if #dispres = yes
    {
    set %use_heal_potions 1
    set %timer_heal #time - %duration_heal_pots
    }
    ;Sets a variable to not run setup again.
    set %setup_done 1
return

4
Well, title says it all!

I used a few lines from Galeamar's Sampire Hunter in my script to attack and honor monsters, but nothing big though...

May I post it here? I have never posted something before=)

5
New member introductions / Another returning Player!
« on: May 27, 2012, 03:26:06 AM »
Hi everyone, I'm krustenkrabbe (which is German for "crusty crab" =). 25 years old and a returning player to UO on the official servers.

I started playing UO in 1999 on Europa (didn't want to play on Drachenfels!) when a friend from school told me about the game.
While waiting for the order to be shipped (there were no digital downloads back then!), we were reading everything we could find about the game, I remember us making plans on how to advance from small houses to a tower to a castle... well when I finally quit around 2002 I had a small log cabin in the swamps north of Trinsic ;)
I was back for a while after Mondains Legacy came out, but I don't really remember much from then, I think I just reactivated an account and wandered a little bit around, too many changes back then for me to get used to it.
Well, last month I decided to give it a try again and although I'm still far away from getting all the new stuff I really enjoy the game now... I already built a sampire to stand a chance in PvM (it's all about the items now) and am decorating my house.

Well about scripting... I started out as a pure ressource gatherer, my first weeks in UO were just spent mining and then selling the Ingots at the forge or bank in Britain. Naturally, I soon looked for means of speeding that up and so I slowly discovered the possibilities of macroing. It started with UOLoop and UO Auto Pilot, but when I discovered EasyUO a lot of things were suddenly possible!
I'm not a great programmer myself, just capable of doing basic stuff (I'm studying civil engineering in RL, not computer sciences), but I'm having a lot of fun using other peoples scripts and sometimes making little adjustments to them to better fit my needs=)

Well that said, I'll hope to join a great community. From what I've read there's still a lot of active guys on these forums.

Greetings from Germany
krustenkrabbe

Pages: [1]