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.


Messages - VicVega

Pages: [1] 2 3 ... 5
1
Scripting Chat / Re: Droping items problem
« on: January 24, 2010, 09:49:18 AM »
Do you mean that you can drop items in a tile distance from the character without problems?

I've tested it with only a tile back and it has the same problem.

2
Scripting Chat / Droping items problem
« on: January 24, 2010, 07:23:56 AM »
Si I've started to play again and I have some problems with my fishing script (wich worked fine before).

Droping boots of fishes in particular. So drops fishes and boots fine till a moment when it drops the fishes or the boots, and they go right back to the backpack.

So it enters in an infinite loop.

Code: [Select]
sub dropBoots
  set %bootsType TVI_ZVI_ZVI_PVI_NVI
  finditem %bootsType C_ , #backpackID
  while #findKind <> -1
  {
    exevent drag #findID #findStack
    wait 1s
    exevent dropg #charPosX #charPosY #charPosZ
    wait 1s
    finditem %bootsType C_ , #backpackID
  }
return

So now I've made a change in this part and it generates a random number (0 or 1) in order to drop the items right at my feet or a tile before:

Code: [Select]
sub dropBoots
  set %bootsType TVI_ZVI_ZVI_PVI_NVI
  finditem %bootsType C_ , #backpackID
  while #findKind <> -1
  {
    set %dropPosY #charPosY - #random % 2
    exevent drag #findID #findStack
    wait 1s
    exevent dropg #charPosX %dropPosY #charPosZ
    wait 1s
    finditem %bootsType C_ , #backpackID
  }
return

That works better but still it gets stuck droping fishes or boots, but much less times.

When this happens I've tried stoping the script and write a little one in order to drop the items and it happens the same, unless I change the tile I'm droping them.

Any idea why this could be happening?

I've stop playing for almost a year and I'm playing in the same server.

3
Scripting Chat / Re: Tile problems
« on: January 22, 2010, 04:11:07 PM »
Fixed, it seems there was a registry key problem: http://www.easyuo.com/forum/viewtopic.php?p=360334#360334

4
Scripting Chat / Re: Tile problems
« on: January 22, 2010, 03:22:19 PM »
I had used before the tile command with success without using #curskind or indicating the facet.

Anyway, I've tried it again with #curskind as in your sub but not luck either.

So I can't get to retrieve the #tileCnt info with something like this:

Quote
tile init
tile cnt #charposX #charPosY #curskind

And therefore I can't use the tile get command that doesn't seem to work anyway.

May be there was an update in the server that disable the tile command?

I'm in a server which you must update the UO with the official OSI patches and then you use razor to connect to the server, so I think the configuration should be simmilar to OSI, althought it's a run UO server.

Don't know if that information I give it's useful

Thanks anyway.

5
Scripting Chat / Re: Tile problems
« on: January 22, 2010, 02:51:09 PM »
The facet it's Trammel in new heaven.

6
Scripting Chat / Tile problems
« on: January 22, 2010, 02:38:25 PM »
I've been out of UO for a while, I'm glad this forum it's still up and active.

So here is my question, I'm trying to use my macros but I have a problem with the tile comand which I don't understand.

So I try this:

tile init
tile cnt #charPosX #charPosY
tile get #charPosX #charPosY

But I don't get any results on the #tileCnt, #tileZ or #tileType variables.

Anything I could be missing?

PS: I also tried indicating the facets.

7
Script Debug / Mining 0.1 for Public Testing
« on: June 07, 2009, 09:10:44 AM »
Features: This script recalls to the mining spot, when overloaded recalls home and drops the ores and the jewelry to a chest in your home, and then recalls to the next mining spot on your runebook. If your shovel brokes, recalls home, picks up iron and tinkering tools from the chest and makes a new shovel. The script also writes to a miningData.txt file some data about your mining rates.

Here is a miningData.txt sample output:

Quote
Start Time: 18:08:01
Time: 18:18:21 | Time Mining: 00:10:20 | Ore Mined: 159 | Ore Per Hour: 923
Time: 18:28:21 | Time Mining: 00:20:20 | Ore Mined: 318 | Ore Per Hour: 938
Time: 18:38:40 | Time Mining: 00:30:38 | Ore Mined: 480 | Ore Per Hour: 940

Here is the mining.txt code, you need another three auxiliar scripts included on the zip:

Code: [Select]
;=================================================================
; Script Name: Mining
; Author: VicVega
; Version: 0.1
; Shard OSI / FS: UO Legends
; Revision Date: 7/5/2009
; Purpose: Mines, recalls, drops ores and mines again
; Globals: None
;=================================================================
; Instructions: You need auxiliar scripts saveTextFoFile.vbs, runebooks.txt and
; makeShovel.txt to be in the same folder as this script.
; You need to setup each mining position coords at the
; setupMiningPos sub. You need a runebook with the mining spots in order.
; Example: First Runebook Slot = First Mining Spot,
; Second Runebook Slot = Second Mining Spot ...
; You must specify the spot's number at %maxRunes variable
; You must specify in wich slot it's your rune for recalling home at the
; %runeHomeNo variable.
; You need a wood chest outside your home in order to drop the ingots and jewels.
; If your character it's an elf, you must adjust the %maxWeight variable
; Thanks: TrailMyx for his ConvertTimeHourMinSec sub
;         JoMac for his saveTextToFile.vbs script
;         Vito for his runeBook.txt script
;************************ Setup **********************************
gosub setup
;*********************** Main Loop *******************************
repeat
  gosub checkWeight
  gosub saveData
  gosub recallMiningPosition
  gosub mining
until #charGhost = yes
halt
;************************* Subs **********************************
sub setup
  gosub setupMiningPos
  set %maxWeight #maxWeight + 40
  set %oreType DWJ
  set %shovelType TWF_QPF
  set %recallType recall
  set %woodenChestType JIF
  finditem %woodenChestType G_2
  set %woodenChestID #findID
  gosub saveStartData
return

sub setupMiningPos
  set %posX1 xxxx
  set %posY1 xxxx
  set %posX2 xxxx
  set %posY2 xxxx
  set %posX3 xxxx
  set %posY3 xxxx

  set %homeX 733
  set %homeY 720

  set %runeHomeNo 8
  set %runeNo 0
  set %maxRunes 3
return

sub saveStartData
  set %startTime #scnt
  set %lastSave %startTime
  gosub time #time
  set %oreMined 0
  gosub writeStartData
return

sub writeStartData
  execute SaveTextToFile.Vbs #false #false #curPath miningData.txt
  + Start Time: %time
return

sub saveData
  if #scnt >= %lastSave + 600
  {
    set %timeMining #scnt - %startTime
    gosub ConvertTimeHourMinSec %timeMining
    set %timeMiningConverted #result
    set %lastSave #scnt
    set %orePerHour ( %oreMined * 3600 ) / %timeMining
    gosub time #time
    gosub writeData
  }
return

sub writeData
  execute SaveTextToFile.Vbs #false #false #curPath miningData.txt
  + Time: %time |
  + Time Mining: %timeMiningConverted |
  + Ore Mined: %oreMined |
  + Ore Per Hour: %orePerHour
return

sub recallHome
  call runeBook.txt %recallType %runeHomeNo
  gosub waitingRecallPos %homeX %homeY
return

sub recallMiningPosition
  set %runeNo %runeNo + 1
  if %Runeno > %MaxRunes
    set %runeNo 1

  set %posX  %posX . %RuneNo
  set %posY  %posY . %RuneNo

  wait 10
  call runeBook.txt %recallType %runeNo
  gosub waitingRecallPos %posX %posY
return

sub waitingRecallPos
  set %maxTimeOut 10
  set %posX %1
  set %posY %2
  set %timeOut #scnt + %maxTimeOut
  while #charPosX <> %posX && #scnt < %timeOut
    wait 1s
  set %timeOut #scnt + %maxTimeOut
  while #charPosY <> %posY && #scnt < %timeOut
    wait 1s
  if #scnt >= %timeOut
  {
    call runeBook.txt %recallType %runeNo
    gosub waitingRecallPos %posX %posY
  }
return

sub checkWeight
  if #weight >= %maxWeight
  {
    if %spotDepleted = #false
      set %runeNo %runeNo - 1
    gosub recallHome
    gosub dropItemsChest %oreType
    gosub dropJewels
  }
return

sub dropJewels
  set %turquoise ZWS
  set %fireRuby VWS
  set %darkSapphire AXS
  set %blueDiamond GXS
  set %perfectEmerald UWS
  set %ecruCitrine TWS

  gosub dropItemsChest %turquoise
  gosub dropItemsChest %fireRuby
  gosub dropItemsChest %darkSapphire
  gosub dropItemsChest %blueDiamond
  gosub dropItemsChest %perfectEmerald
  gosub dropItemsChest %ecruCitrine
return

sub dropItemsChest
  finditem %1 C_ , #backpackID
  while #findKind <> -1
  {
    if #findType = %oreType
      set %oreMined %oreMined + #findStack
    exevent drag #findID #findStack
    wait 10
    exevent dropc %woodenChestID
    wait 2s
    finditem %1 C_ , #backpackID
  }
return

sub mining
  set %spotDepleted #false
  gosub tileName
  while #weight <= %maxWeight && %spotDepleted = #false
  {
    gosub useShovel
    gosub scan
  }
return

sub scan
  set %timeout #scnt + 15
  set %jrnl #jindex
  scanjournal %jrnl

  while #scnt < %timeout
  {
    if %jrnl < #jindex
    {
      set %jrnl %jrnl + 1
      scanjournal %jrnl
    }

    if you_dig in #journal || loosen_some in #journal
    {
      set %spotDepleted #false
      return
    }

    if there_is_no_metal in #journal
    {
      set %spotDepleted #true
      return
    }
  }
return

sub useShovel
  set #lTargetKind 3
  set #lTargetX #CHARPOSX
  set #lTargetY #CHARPOSY
  set #lTargetZ #charPosZ
  finditem %shovelType C_ , #backpackID
  while #findKind = -1
  {
    gosub recallHome
    call makeShovel.txt
    set %runeNo %runeNo - 1
    gosub recallMiningPosition
    finditem %shovelType C_ , #backpackID
  }
  set #LOBJECTID #FINDID
  event macro 17
  target 3s
  event macro 22
return

sub tileName
  set %miningPosX #charPosX + %x
  set %miningPosY #charPosY + %y
  tile init
  tile cnt %miningPosX %miningPosY
  for %j 1 #tilecnt
  {
    tile get %miningPosX %miningPosY  %j
    set %canMine cave_floor in #tileName
    if %canMine
    {
      set #lTargetTile #tileType
      return #true
    }
  }
return

sub time
  set %time %1
  str ins %time : 3
  set %time #strRes
  str ins %time : 6
  set %time #strRes
return

; %1 = input - Time to convert
; #RESULT -  Time converted to H:MM:SS format
sub ConvertTimeHourMinSec
  namespace push
  namespace local ctime
  set !hourpart %1 / 3600
  set !secpart ( %1 % 3600 ) % 60
  set !minpart ( ( %1 % 3600 ) / 60 )

  if !hourpart >= 10
    set #RESULT !hourpart , :
  else
    set #RESULT 0 , !hourpart , :
  if !minpart < 10
    set #RESULT #RESULT , 0
  set #RESULT #RESULT , !minpart , :
  if !secpart < 10
    set #RESULT #RESULT , 0
  set #RESULT #RESULT , !secpart
  namespace pop
return #RESULT

8
Scripting Chat / Re: Looping a mining script
« on: June 05, 2009, 01:41:58 AM »
That's exactly what I was looking for, thanks.

I've changed already my script, I will publish it when I test it a little more.

9
Scripting Chat / Re: Looping a mining script
« on: June 04, 2009, 12:29:26 AM »
Hi,

I think you can reduce the main loop.

First .. you have to do the weightcheck while you do mining !
In your loop you would not be able to recall if you digged to much ore .

You don't need the 1st sport, 2nd spot .... stuff,
you mining sub has to decide the most stuff..

your Mining SUB is the most important thing I guess:
you need to make sure it handles ..
- get / create Mining Tools
- check for overweight
- call SUB to travel home for dropoff
- when this mining spot is done ... inc. a counter to prepair the next recall


Main Loop concept
Code: [Select]

repeat
{
      gosub recall to workplace
      gosub mining ; <- does Weightcheck, and sets a marker for next spot to mine or dropoff location
}
until #charGhost = yes


Thanks for your advices, I'll study them in order to think a way to improve my code. But I don't really like to complicate my mining sub adding all that stuff inside, but may be you are right and it's a better way.

Quote
First .. you have to do the weightcheck while you do mining !
In your loop you would not be able to recall if you digged to much ore .

I also do a weightCheck while mining, but I also do a check in case there is no more ore. So when mining, the mining sub can exit in two ways: because overweight or because there is no more ore, so I must use the "checkWeight sub"  in oder to know wich one it is and act accordingly.

The complete script at the moment, hope clarify this:

Code: [Select]
gosub setup

sub setup
set %pickAxeType QPF
set %recallType recall
return

repeat
      gosub checkWeight
      gosub recall firstSpot
      gosub mining
      gosub checkWeight
      gosub recall secondSpot
      gosub mining
until #charGhost = yes
halt

sub recall
    if %1 = home
    {
     set %posX 733
     set %posY 720
     set %runeNo 1
    }
    if %1 = firstSpot
    {
     set %posX 1419
     set %posY 3758
     set %runeNo 2
    }
    if %1 = secondSpot
    {
     set %posX 1419
     set %posY 3751
     set %runeNo 3
    }
    call runeBook.txt %recallType %runeNo
    gosub waitingRecallPos %posX %posY recall
return

sub waitingRecallPos
    set %maxTimeOut 5
    set %timeOut #scnt + %maxTimeOut
    while #charPosX <> %1 && #scnt < %timeOut
          wait 1s
    set %timeOut #scnt + %maxTimeOut
     while #charPosY <> %2 && #scnt < %timeOut
          wait 1s
     if #scnt >= %timeOut
         gosub %3
return

sub checkWeight
  if #weight > #maxWeight
  {
     gosub recall home
     gosub dropItemsChest
  }
return

sub dropItemsChest
set %woodenChestType JIF
set %goldType DWJ
finditem %woodenChestType G_2
set %woodenChestID #findID
finditem %goldType C_ , #backpackID
exevent drag #findID #findStack
wait 2s
exevent dropc %woodenChestID
wait 2s
return

sub mining
      event sysmessage mining!
      gosub tileName
      while #weight <= #maxWeight && #result = #true
      {
      gosub usePicket
      gosub scan
      wait 2s
      }
return

sub scan
  set %timeout #scnt + 15
  set %jrnl #jindex
  scanjournal %jrnl

  while #scnt < %timeout
  {
    if %jrnl < #jindex
    {
      set %jrnl %jrnl + 1
      scanjournal %jrnl
    }

    if ( you_dig in #journal || loosen_some in #journal )
      return #true

    if ( there_is_no_metal in #journal || no_quedan_minerales in #journal )
      return #false
  }
return

sub UsePicket
  set #lTargetKind 3
  set #lTargetX #CHARPOSX
  set #lTargetY #CHARPOSY
  set #lTargetZ #charPosZ
  finditem %pickAxeType C_ , #backpackID
  set #LOBJECTID #FINDID
  event macro 17
  target 3s
  event macro 22
return

sub tileName
    set %miningPosX #charPosX + %x
    set %miningPosY #charPosY + %y
    tile init
    tile cnt %miningPosX %miningPosY
    for %j 1 #tilecnt
    {
     tile get %miningPosX %miningPosY  %j
     set %canMine cave_floor in #tileName
     if %canMine
     {
     set #lTargetTile #tileType
     return #true
     }
    }
return

10
Scripting Chat / Looping a mining script
« on: June 03, 2009, 01:27:26 PM »
So my mining script it's something like this at the moment (I only post now the significant code, the main loop):

Code: [Select]
repeat
      gosub checkWeight
      gosub recall firstSpot
      gosub mining
      gosub checkWeight
      gosub recall secondSpot
      gosub mining
until #charGhost = yes

Hope somebody gives me an idea how to loop this with less repetitive or redundant code in order to add mining spots and have a code less horrible.

11
Scripting Chat / Re: About mining
« on: June 02, 2009, 03:28:20 AM »
I found the Cyberpope's Mining radar wich provides information about 8x8 resource grid zones.

12
Scripting Chat / About mining
« on: June 01, 2009, 01:23:22 PM »
I've found a hall 40 tiles long and 3 tiles wide all minables.

Something like this:

########################################
########################################
########################################

So if my character stands like this and mines in this four spots:

1#2#####################################
#C######################################
3#4#####################################

It also would mine the other spots one tile around the character?

And even more important, how many tiles should the character advance in order to get to a spot not depleted and mine again?

13
Script Debug / Re: Animal Taming 0.1 for Public Testing
« on: June 01, 2009, 01:58:03 AM »
I finally got around to testing this script. I got my butt thrown in jail the other day for using Maddog's Jhelom Bull Pen Trainer so some other method to get gains is urgently needed. 8)

I added Gamans to the list which are great for gains I really don't understand why more people don't tame gaman's to 120 instead of Bulls. I 120'd my first tamer off Gamans. Totally secluded and virtually danger free....

Anyways...I couldn't get the script to work for me. After taming the Gaman it would give the All Follow Me command but wouldn't release newly tamed pet and dismount and kill it. When I manually released the pet it killed it but then the script just sat there idle.

Not quite sure where the problem lay. It could be my end with my client. There are quite a few scripts that won't run on my main computer but will on my computer which runs Windows Vista. I'll try it on my 2nd computer as well and see if the results are any different.

Hopefully someone else also gives this a try because we really do need more taming scripts. ;)

In order to release the pet I use this command:

Quote
exevent popup %tameID 10

May be you are on a Sphere shard? (Sphere shards don't support the exevent popup command)

Or may be you are in a shard wich is RunUO but doesn't support exevent popup command anyway.

If exevent popup works fine on your shard, may be the entries on the context menu when you click on the animal are different and it's not the 10th entry wich has the "release" option, in that case you should change "10" by the entry number of your "release" option.

If the exevent popup command doesn't prompt the pop up confirmation window about releasing the pet, the script will loop on this line:

Quote
  exevent popup %tameID 10
  while %waitForGump = #true
...

14
Script Debug / Re: Animal Taming 0.1 for Public Testing
« on: June 01, 2009, 01:47:00 AM »
Feel free to modify the script, I don't mind.

I know I could support other methods of killing, but I don't have a tamer with the skills to do so and I prefer to test the script in order to know if it works fine at least for me.

I'm glad you like the code.

15
Script Debug / Re: Problems with Skill Gaining calculator script
« on: May 27, 2009, 11:50:42 PM »
I agree, also punch Mickey in the face for me if you have the ocassion, always wanted to do it.  ;D

Look out, he is swinging his arm!


Pages: [1] 2 3 ... 5