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 - graysont

Pages: [1]
1
Figured out the timing ... pasting it below if anyone else is interested in something similar.

Code: [Select]
program scanhorizons;

const seconds15 = (1/(24 * 60 * 60)) * 15; // 15 seconds

var time15 : TDateTime;
label startscan;

procedure scanhorizons;
begin
  UOSay('; scan the horizons');     
end;

begin
 time15 := Time;
 startscan:                       
 if (Time > time15) then
 begin                   
    time15 := Time + seconds15;   
    scanhorizons;
 end; 
 goto startscan;
end.

Though if anyone can tell me about how one script can control another script would appreciate it, thanks!

2
This is for pascal.

I have a fisher on a boat. Every 15 seconds I get to "scan the horizons" and see whether any other boats are in the vicinity. If there are, I want to go home.

Preferably, in 1 script I would scan the horizons, set a variable with a timestamp, then do my fisher functions ... and at several places in loops I would check that timestamp, and if it has been over 15 seconds, I'd perform the scan the horizons again, set the timestamp again, then continue with the script.

I saw "function Timer: Cardinal", but there's no examples and I'm not sure the syntax of setting the variable and comparing whether 15 seconds have passed.

Alternatively, I could run a 2nd script something like this ...

begin
 startscan:       
 scanhorizons;     
 wait(15000);
 goto startscan;
end.

The problem with this is if the 2nd script decides it needs to go home ... and it is going to cast recall, it would somehow have to pause or stop the other script (and I'm not sure if that can be done or how to do that).

So in summary ... I want to set a timestamp variable that I can check whether 15 seconds have passed since it was set, or ...

I need to know how to have one script pause another script.

Any ideas would be appreciated, thanks!

3
Stealth Client / Re: Reliably switching between accounts automated?
« on: August 03, 2016, 05:53:01 AM »
If I understand you properly, each account has a script that auto plays when it connects, and you can set when it reconnects with the auto feature ...

Now, is there a command to have an account disconnect when it is finished with its script?

4
Stealth Client / Reliably switching between accounts automated?
« on: August 02, 2016, 10:05:05 PM »
I want to collect bods on a free server. There will be a lot of logging in and logging out as I switch between the various accounts at scheduled times.

Is there functionality inside Stealth Client to reliably switch between accounts?

When you first load up Stealth, it only shows the last char played for me, loaded from a certain config file. My thoughts are to make a different directory for every account I want to run, run multiple instances of Stealth -- each instance only loads one account, have it auto load the 1 character upon firing it up ...

Then use visual basic to rewrite that config file so I can switch between various accounts and different slots on each account, and have visual basic be responsible for scheduling the launching of a new stealth client and closing it down once the bod is obtained.

Before I do that, however, is there functionality in Stealth itself to reliably switch between accounts and characters?

5
Stealth Client / Re: How to Fix Problems With Reading Journal in Stealth
« on: August 02, 2016, 09:56:54 PM »
You are right and wrong. You can handle the clilocID yourself and not need to handle the text string.
This is much better, since it not depend on specific localisation but can handle it "raw" as it is.

Thank you. I had no idea that cliloc's were for the purpose of processing messages like that. Makes it a whole lot easier.

6
I had an issue, ended up resolving it myself. I'll explain it here because I'm sure others will have the same problems I did.

Easyuo has the feature when you find an item type, it returns an array that you can loop through. Something like this ...

Code: [Select]
finditem DWJ c_ , #backpackid
  for #findindex 1 #findcnt
    {
      ... do stuff with each item, whether you found 1 or 1000, accessing items using #finditem ...
    }

It was a challenge figuring out how to achieve the same functionality in Stealth. Most of the find functions (except FindType) lump all the items you find that are similar into one item count. If you're looking to loop through a series of items you find that are similar, here's a little minimal application I wrote that simply loops through all the large-sized ore at your feet, double clicking them.

Code: [Select]
Program New;

const
Ore=$19B9;


procedure doubleclickore;
  var
  b : Integer;
  i : Integer;
  List: TStringList;
 
begin
  FindDistance := 3;
  FindType(Ore,Ground);
  if(FindCount > 0) then
  begin
    List := TStringList.Create();
    GetFindedList(List);
    for i := 0 to List.Count -1 do
    begin
    b := StrToInt('$'+List.Strings[i]);
      UseObject(b);
      wait(2000);
    end;
  end;
end;   
 
Begin
 doubleclickore;
End.

7
Stealth Client / How to Fix Problems With Reading Journal in Stealth
« on: August 01, 2016, 11:44:45 AM »
After spending many hours pulling my hair out wondering why none of the commands for reading the journal worked for me, I finally realized that in Settings > Common ...

you have to click "Show Cliloc text in journal" ...

It's the only way Stealth will be able to read your journal or be able to use the commands:

InJournalBetweenTimes
LastJournalMessage
etc.

Once I clicked that little box, my routine started working without a problem ...

Code: [Select]
   while(injournalbetweentimes('no metal',TimeParser,Now) = -1) do
    begin
        UseObject(FindType(Shovels,Backpack));
        shovelwait;
        TargetToXYZ(tX,tY,GetSurfaceZ(tX, tY, WorldNum));  
        Wait(1000);
    end;

8
Stealth Client / Re: Looking For Mentor?
« on: August 01, 2016, 01:45:32 AM »
Your server is different than mine, mine doesn't have those new jewels in it. The ore on my server is heavy ... 24ish ore and I have to smelt or drop. My first versions are recall miners ... they're earning about 5k ingots per hour.

But they're too obvious, can't be recalling to bank's on this many for very long without getting found out.

So my next version is an ore leapfrogger ... once every 3 steps it mines along a mountain side, and then passes the ore 3 tiles ahead. That one will produce more ingots and won't be so obvious (unless people are finding my low traffic spawns).

Ideas ...

Boat miner. Script saying "left one" etc. to change from spot to spot. Test the decay on your shard to make sure your ore will last.
Recall miner. Slightly obvious. Mark all the banks so your guys aren't showing up to same one over and over. Use polymorph if you can.
Leap-frogger. Script going along moving the ore as you go. This is one I've highest hopes for at the moment because ore is so heavy on the server I'm on.
Recall/rail ... if ore is light on your server, recall in and mine several spots, less recalling that way.
Rail with packies. What I see most people doing on my server, but packies can be attacked or led off by bad spawn.

9
Stealth Client / Re: Looking For Mentor?
« on: August 01, 2016, 01:01:19 AM »
For the gems, i would recommend to use an array; and work with array becouse constructions like
Code: [Select]
while((count(Jewel1) + count(Jewel2) + count(Jewel3) + count(Jewel4) + count(Jewel5) + count(Jewel6) + count(Jewel7) + count(Jewel8) + count(Jewel9) + count(Jewel10)) > 0) this are not the thing that should be done ever...


[/quote]

I am a super newbie pascal user who has tackled pascal for an entire sum of perhaps 12 hours, who has never used Stealth or pascal before that.

And I've written a dozen miner routes that will likely pull in about 1 mil gold worth per ingots a day on a freeshard.

It either works, or it doesn't work. :p  My scripts are working.

BTW, my Gem set happens to be the same gems you buy from jeweler (diamonds, rubies, etc).

Feel free to post your far more elegant method of putting gems in the bank and I'll declare you king of pascal, delete my working function and replace it with your better function that does the same thing. :p

10
Stealth Client / Re: Looking For Mentor?
« on: August 01, 2016, 12:17:01 AM »
Hey cool thanks, I'll add that to my Z coordinate:

Now I have another question I'm trying to create a type of gems youo get from mining I type this and get this error

Code: [Select]
type
    GemType = ($3197, $3195, $3193, $3192, $3198, $3194);  

02:49:47:516 [Miner]: Compiling
02:49:47:516 [Miner]: Compiler: [Error] (test.pas at 29:13):  Identifier expected but "$3197" found ;
Error line is: "     GemType = ($3197, $3195, $3193, $3192, $3198, $3194);      "
02:49:47:528 [Miner]: Compiling failed
02:49:47:528 [Miner]: Script test.pas stopped successfuly

EDIT: Scratch this, but still wondering why this doesn't work... Read your code you have and will use something similar the way you have your ore.


This is what I'm using.

Code: [Select]
// JEWELS
const
Jewel1=$0F16;
Jewel2=$0F15;
Jewel3=$0F10;
Jewel4=$0F13;
Jewel5=$0F26;
Jewel6=$0F21;
Jewel7=$0F16;
Jewel8=$0F19;
Jewel9=$0F25;
Jewel10=$0F2D;

Then later in a procedure ...

Code: [Select]
// ***** PUT JEWELS IN BANK
    while((count(Jewel1) + count(Jewel2) + count(Jewel3) + count(Jewel4) + count(Jewel5) + count(Jewel6) + count(Jewel7) + count(Jewel8) + count(Jewel9) + count(Jewel10)) > 0) do
      begin                    
        FindTypesArrayEx([Jewel1,Jewel2,Jewel3,Jewel4,Jewel5,Jewel6,Jewel7,Jewel8,Jewel9,Jewel10],[0],[backpack],false);    
          begin
            MoveItem(finditem,0,Bank,0,0,0);
            wait(2000);      
          end      
      end;

That's assuming you put Bank as ...
Bank := objAtLayer(BankLayer);

and declared as

Var Bank : Cardinal;

Post Merge: August 01, 2016, 02:34:01 AM
By the way, I figured out the difference between cave floors and mountain walls.

If you're mining cave floors, TargetToTile works, something like ...

TargetToTile(1343,1649,2898,0);

But if you're doing mountain walls, use TargetToXYZ, like ...

TargetToXYZ(2615,60,21);

I'm going to try out that GetSurfaceZ(x, y, WorldNum) function because that's a lot better than what I've been doing (clicking like crazy on mountain walls trying to find the real Z).

Incidentally, the difference between TargetToTile and TargetToXYZ in Stealth is exactly the same as the difference between SET #LTARGETKIND 3 and SET #LTARGETKIND 2 in easyuo ... Stealth has different functions whereas easyuo is just using 2 vs 3 as a parameter in targeting the tile.

Interested in mining the mountain walls because there's so many of them, and cave floors are too populated and chances of players interacting or PKing are higher lol.


11
Stealth Client / Re: Looking For Mentor?
« on: July 31, 2016, 07:31:35 PM »
"is there a way to target by relative tile? ie: always target 1 tile to east."

In short, probably not. I've researched all the mining-related macros available on the internet for Stealth. In the Russian forum I'd find a post and then everyone's claiming it says "cannot see location" when trying to use their script.

I've been using Stealth for a couple days now. What I've found is the "tile" that Stealth needs in order to target the tile at x / y / z is the exact same tile number you can get from easyuo ... so you can record an area's information with easyuo and output it to Stealth and that works.

Example ...

This line in Stealth will properly target a tile to mine it (but only cave floor, not mountain edge) ...

TargetToTile(1343,1649,2892,0);   

1343 is easyuo #LTARGETTILE
1649 is easyuo #LTARGETX
2892 is easyuo #LTARGETY
0 is easyuo #LTARGETZ

This only works on cave floors. The reason being, easyuo lets you set #LTARGETKIND ... and mountain sides are often different #LTARGETKIND than cave floors, and I'm failing to see in Stealth UO where you can set #LTARGETKIND.

I've tested using Stealth to find tiles ... the problem is I can find the tile # but I don't know how to reference it. I see the tile # when debugging, but it's nested in a very deep array and can't figure out how to reference it, and the variable name they used for it was only found on 1 page on the entire internet and it was in python and I'm using pascal ... I gave up trying to access that value and I just made an easyuo recorder that stores the values I get manually and then I convert the values to Stealth.


Post Merge: July 31, 2016, 07:37:55 PM
That code posted above, does it actually work for anyone? Drbadan, do you actually use that code successfully?

Because it's taken from here ...

http://forum.uorpg.net/viewtopic.php?t=7990

And you yourself posted this to that ...

[04:25:36:796] You see: Drabadan
[04:25:39:156] System: Where do you want to use the Iron pickaxe?
[04:25:39:593] System: You have no line of sight to that location
[04:25:40:078] System: Where do you want to use the Iron pickaxe?
[04:25:40:281] System: You have no line of sight to that location
[04:25:42:843] You see: 3 уровень
[04:25:42:843] You see: Drabadan
[04:25:44:578] System: Where do you want to use the Iron pickaxe?
[04:25:44:937] System: You have no line of sight to that location
[04:25:45:359] System: Where do you want to use the Iron pickaxe?
[04:25:45:843] System: You have no line of sight to that location
[04:25:46:265] System: Where do you want to use the Iron pickaxe?
[04:25:46:625] System: You have no line of sight to that location
[04:25:47:875] System: Where do you want to use the Iron pickaxe?
[04:25:48:312] System: You have no line of sight to that location
[04:25:53:390] System: Where do you want to use the Iron pickaxe?
[04:25:53:875] System: You have no line of sight to that location
[04:25:54:328] System: Where do you want to use the Iron pickaxe?
[04:25:54:765] System: You have no line of sight to that location

So did you actually get it to work? If so, how?

12
New member introductions / Hello everyone!
« on: July 29, 2016, 03:26:07 PM »
Hi there. My name is Kevin. If you remember it, I'm the original creator of Finduo search engine for vendors many years ago (though sold it a long time ago).

I'm interested in scripting again ... really want to get into uostealth. I'm posting an intro so I can have access to the uostealth scripts, the documentation and examples found on the net are mostly documented in Russian and it's really hard to wrap my head around.

Thank you!

Preemptive beef up of intro, so it passes the mods incoming ... :p

So the original finduo was based on a combination of easyuo and a visual basic program I wrote. My search was the first one to offer images of the items that were being sold. To do that I made a VB program and used the easyuo "send" option to communicate with VB ... whenever it found an item it didn't know what the picture was, I took a snapshot of the open vendor with VB as image 1, then I used easyuo to hide all the other items in the backpack and took a 2nd image ... then I removed the pixels of the backpack, and removed the pixels that were different from image #1 and image #2, and the remaining pixels were the image I saved to show the item's graphic on the search.

Within weeks of me adding images, searchuo did the same as well as that other search -- was a strategic arms race back then.

Anywho ... please let me in :p

Post Merge: July 29, 2016, 03:46:12 PM
Oh, and apparently I contributed here a very long time ago. Example:

http://www.scriptuo.com/index.php?topic=302.10;wap2

I don't even recall if I had an account here or what the login must have been, but that was me explaining Finduo probably some 7/8ish years ago?

Pages: [1]