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

Pages: 1 [2]
16
Stealth Client / CheckLOS function broken?
« on: September 03, 2016, 01:14:49 PM »
Hello, I'm trying to use the function CheckLOS. But it seems not to work, anybody else having this issue?

It's always returning False, even if I'm clearly in LOS.

Code: [Select]
if checkLOS(GetX(self), GetY(self), GetZ(self), GetX(test), GetY(test), GetZ(test), WorldNum) then
  AddToSystemJournal('Target is in sight!');

17
Stealth Client / Stealth Becomes Unresponsive
« on: August 20, 2016, 03:58:18 PM »
Hey guys, running new StealthUO.

Everytime I leave the program unattended for 10 minutes or so it will become unresponsive.

I've ran in admin mode, tried all compatibility modes. Any thoughts?

18
Just thought I'd share what I use.

Code: [Select]
Procedure Smelt();
var
i : Integer;
begin
     Wait(300);
     OreType;
     for i := Low(Ore) to High(Ore) do
     if(FindType(Ore[i], Backpack) > 0) then       
     begin
         while Count(Ore[i]) > 1 do     
         begin
             AddToSystemJournal('Smelting Ore: ' + IntToStr(Ore[i]));
             UseObject(FindItem);
             WaitTargetObject(FireBeetle);
             Wait(1000);
         end;
     end; 
     UseObject(FireBeetle); 
     Wait(300);
end;
Procedure OreType();
begin
    Ore[0] := $19B9; //large pile
    Ore[1] := $19B8; //medium pile
    Ore[2] := $19BA; //small pile 1
    Ore[3] := $19B7; //small pile 2   
end;

19
Stealth Client / Comparing Range of Two Objects
« on: August 13, 2016, 07:26:31 PM »
I wasn't sure if there was an API to compare two objects distances from one another, I know you can search an objects range from your self with FindDistance; ...

Either way I came up with my own version so I would like to share it with you guys if you ever find you need to compare the distance between two objects.

Example:

Check if Chest2 is within 2 tiles of Chest1...

Code: [Select]
Program Example;

Type
    TileCord = record
        x, y : Integer
    end;

Var
   TileRange : Array of TileCord;

Function SeekRange(ObjOne, ObjTwo : Cardinal; Range : Integer) : Boolean;

Var

x, y, i : Integer;

begin

Result:= False;
SetLength(TileRange, 0);
 for x := (-1 * Range) to Range do      
  for y := (-1 * Range) to Range do
  begin
   SetLength(TileRange, Length(TileRange) + 1);
   TileRange[High(TileRange)].x := (GetX(ObjOne) + x);
   TileRange[High(TileRange)].y := (GetY(ObjOne) + y);
  end;
for i := Low(TileRange) to High(TileRange) do  
 if TileRange[i].x = (GetX(ObjTwo)) then
  for i := Low(TileRange) to High(TileRange) do
   if TileRange[i].y = (GetY(ObjTwo)) then
    Result := True;
            
end;

//Main Body
begin
 if SeekRange(Chest1, Chest2, 2) = True then
 // what you want it to do =)
end.

20
Stealth Client / Re: Looking For Mentor?
« on: August 01, 2016, 06:00:47 PM »
Hey guys came up with an issue, my script will mine just fine on mountains or random veins in floor out in world.... but it won't mine in caves it will say target cannot be seen. Any ideas why?

Code: [Select]
Procedure FindOre (VAR x, y, z : Integer);
begin
   x:= (GetX(Self)) - 1;   
   y:= (GetY(Self));
   z:= GetSurfaceZ(x, y, WorldNum)
end;
Procedure MineOre(VAR TotalSwing : Integer);
begin
    UseObject(self);
    {use shovel}       
    UseType(Shovel,$0000);
    WaitTargetXYZ(x, y, z);   
    Wait(1000);           
    TotalSwing := TotalSwing + Swing; 
end;

Post Merge: August 01, 2016, 10:01:30 PM
I even tried to manually set the Z to 0 because that's what the tile info said it was... Still says can't be seen.

Post Merge: August 01, 2016, 09:32:39 PM
I also need help with creating a runebook recaller, based off the gump to recall to next spot.

Each gump to the next spot is +6 because it's 5.11.17 etc. up to 16 times.

I want to add +6 to the integer and once it reaches it's limit I believe 97, It will go back to 5.

However in order to press the gump with WaitGump(); it needs to be a string... How can I convert an Integer to a String and then back to Integer so I can add more to it later?

I tried to use google but it's all confusing to me  :-

Code: [Select]
Procedure Recall(VAR Spot : Integer);
begin
   if InJournal('0007AD00') > 0 then
   begin
   Spot := Spot + 6;
   end; 
   UseObject(MineBook);   
   WaitGump('554B87F3');
   IntToStr(Spot); 
   WaitGump(Spot); 
end;

Post Merge: August 01, 2016, 07:48:59 PM
the proper way to use this line would be,

WaitGump(IntToStr(Spot));

after some googling I found an example I could understand =p

21
Stealth Client / Re: Looking For Mentor?
« on: August 01, 2016, 01:56:05 AM »
Yah, I was thinking add Stealing? To use a disguise kit!

22
Stealth Client / Re: Looking For Mentor?
« on: August 01, 2016, 01:11:18 AM »
Now let's not fight! Yes if it works, why fix it? haha but it's good to learn all type of ways to do something some more faster and efficient!

Thanks guys both are of big help! And that's the plan to mine mine mine ore! Get lot's of gold!

Post Merge: August 01, 2016, 05:15:46 AM
Code: [Select]
type
 TWordArray : Array of Word;

function CheckArrayContainsItem(item : Word; arr : TWordArray) : Boolean;
var
 i : Integer;
begin
  Result := False;
 for i := Low(arr) to High(arr) do
   if(item = arr[i])then
    begin
      Result := True;
      break;
    end;  
end;
//For your example it will look like this:
for i := Low(Ore) to High(Ore) do
  if(FindType(Ore[i], Backpack) > 0) then
   AddToSystemJournal('Found the ore: ' + IntToStr(Ore[i]));

Wow PERFECT! that is exactly how I wanted it to work. After reading this example I now understand how the i: integer plays it part in looping.

Post Merge: August 01, 2016, 03:19:15 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...

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

I plan to go to mountainsides as well, sounds less dangerous hehe. Keep in mind I've never mined in my life of UO it's just the easiest way I can think to make simple script and good way to learn, any advice on what spots to hit? I'm estimating you can maybe pull 4k ingots an hour?

23
Stealth Client / Re: Looking For Mentor?
« on: August 01, 2016, 12:53:15 AM »
Hey man, nice reply.

I had question though is there a way to make a loop and check the integers in the arrays rather then type them all out lengthy?

example in uosteam a list would be created and you would check the list and if you found a item matching in the list it would set it as target IE:

Code: [Select]
//create list of 4 items 1-4
@createlist! 'example'
@pushlist! 'example' 1
@pushlist! 'example' 2
@pushlist! 'example' 3
@pushlist! 'example' 4
//search if item matches any value in list
for 0 to 'example'
if findtype (example[], backpack)
moveitem 'found'
endif
endfor

right now I have this:

Code: [Select]
Program Miner;

Const
    Swing = 1;
    Shovel = $0F39;
    Tool = $1EB8;
    Ingot = $1BF2;
    
Var
    TotalSwing : Integer;
    x, y, z : Integer;    
    Ore : Array[0..3] of Integer;
    Gem : Array[0..5] of Integer;
Procedure OreType();
var
k : Integer
begin
     Ore[0] := $19B9; //large pile
     Ore[1] := $19B8; //medium pile
     Ore[2] := $19BA; //small pile 1
     Ore[3] := $19B7; //small pile 2    
     for k := 1 to 6 do
     if FindType(Ore[0], Backpack) > 0 then  
     UOSay('test');
end;  
Procedure GemType();
begin
     Gem[0] := $3197; //fire ruby
     Gem[1] := $3195; //ecru citrine
     Gem[2] := $3193; //turquoise
     Gem[3] := $3192; //dark sapphire
     Gem[4] := $3198; //blue diamond
     Gem[5] := $3194; //perfect emerald  
end;  

right now Ik it will always say 'test' if it finds Ore[0] or maybe this is fix is as easy as just typing:

 if FindType(Ore[0..3], Backpack) > 0 then  

^^ Does not work but will leave unedited for any noobies that come across this.

24
Stealth Client / Re: Looking For Mentor?
« on: July 31, 2016, 11:50:03 PM »
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.

25
Stealth Client / Re: Looking For Mentor?
« on: July 31, 2016, 10:10:45 PM »
Hey guys, I made a easy procedure although probably could be improved so much, but I'm just making things simple atm.. keeping it easy not going over my head lol.

Code: [Select]
{mine to west}   
Procedure MineOre ( VAR x, y, z : Integer );
begin
   x:= (GetX(Self)) - 1;   
   y:= (GetY(Self));
   z:= (GetZ(Self));
end;

basically this is a target by relative in hindsight. the issue I've noticed with it'll target to the west but some mountainsides have a higher Z value, so I'm guessing I'll have to create an array of some sort 0-10 and attempt to determie where I can mine.

26
Stealth Client / Re: Looking For Mentor?
« on: July 31, 2016, 07:30:11 PM »
Code: [Select]
procedure GetTilesToMine;
var
    x, y, i : Integer;
    TileInfo : TStaticCell;
begin
    SetLength(MinTiles_Array, 0);
    for x := (-1 * SeekRange) to SeekRange do
        for y := (-1 * SeekRange) to SeekRange do
            begin
                TileInfo := ReadStaticsXY(GetX(self)+x, GetY(self)+y, 0);
                if TileInfo.StaticCount > 0 then
                    for i := Low(TileInfo.Statics) to High(TileInfo.Statics) do
                        if (TileInfo.Statics[i].Tile >= 1339) and (TileInfo.Statics[i].Tile <= 1359) and (TileInfo.Statics[i].z = GetZ(self)) then
                            begin
                                SetLength(MinTiles_Array, Length(MinTiles_Array) + 1);
                                MinTiles_Array[High(MinTiles_Array)].Tile := TileInfo.Statics[i].Tile;
                                MinTiles_Array[High(MinTiles_Array)].x := TileInfo.Statics[i].x;
                                MinTiles_Array[High(MinTiles_Array)].y := TileInfo.Statics[i].y;
                                MinTiles_Array[High(MinTiles_Array)].z := TileInfo.Statics[i].z;
                            end;                           
            end;
        AddToSystemJournal('Found ' + IntToStr(Length(MinTiles_Array)) + ' tiles to mine.');   
end;

Hey I'm trying to decipher your code but where do we get the value from SeekRange?
Also I was thinking if all my runes will be to the east of a spot, couldn't I subtract -1 from my X location, and it will target to the East always.

27
Stealth Client / Looking For Mentor?
« on: July 30, 2016, 07:55:35 PM »
Hey guys,

You can call me playforfun! I'm looking for someone who would be willing to help me learn Pascal and how to code in Stealth. I really enjoy learning macro/script like tools for UO I consider it a hobby/passion something about it is so ADDICTIVE! To get a game play itself for you is somewhat MAGICAL lol. Anyways I'm a AVID learner I would say and I'm a curious cat, I would say I mastered UOSteam ( not saying much ) but now I want to learn how to ACTUALLY code and learn languages that I can use outside of UO! I'm not just some guy who hops on the forums and asks for free scripts I prefer to make my own things and share them it's more fun that way, I just need some guidance on how to become an efficient coder. I've already dived into trying to learn the StealthAPI but there is much to learn as well as going to websites to learn Pascal. Not trying to bash the creators of stealth but UOSteam documentation was easier to learn and read because of all the examples, maybe cause they weren't Russian? haha!

Here are some things I've accomplished in UOSteam:

Runebook Recaller: Will scan a runebook determine how many runes are in it regardless of name and will recall to them accordingly.
Leather Suit Creator: Will create 125 sets of leather armor, dye them and store them in designated containers.
Stool Macro: Will place stools around a player according to position they are from you.

lol and plenty more but my favorite!

AFK Tamer Macro: Will recall to spots, kill designated monsters, loot corpses, heal pets, run from any incoming damage and heal, recall out if and dangerous players are nearby, play sound file if a GM is shown, automatically restocks, drops off items that want to be kept, sells remaining items to vendors, take break times ( user set )!

haha I'm just sharing some scripts that I've made to show you that I'm serious and want to succeed in stealth the same way I succeeded in UOSteam, will take more effort but I'm willing to give my all! Anyways I'm not allowed to PM and nor do I want to put my Skype publicly for everyone to see but I would like to communicate to whomever is willing to be my teaching buddy hopefully not just via forums!


TLDR;

Looking for someone willing to teach a dedicated student how to code in Pascal efficiently!

thanks for the read guys.

PS: or if your a new learner to pascal and would love to learn with me!


Post Merge: July 31, 2016, 02:45:26 AM
Hey guys update need help with a mining script I'm trying to make..

I need to learn how to create a list of integers that way I can recall down a list of runes, and always have it bookmarked last place I visited. I'm really confused how to do this I see a way to make a list off strings from cromo tutorial... also was  going to make a list for coordinates to mine but I thought is there a way to target by relative tile? ie: always target 1 tile to east.

Anyways this is what I'm at right now, you can tell I use UOSteam alot based off ths script! ( no it's not complete )

Code: [Select]
{
Author: playforfun
Date: 7/30/2106
Version: 1.0
Desription:
Will mine ore until depletion
}

    {start of structure}
 {000FEE46 // You have worn out your tool!
  0007AD00 // There is nothing to mine here.
 }

Program Miner;

Const
    Swing = 1;
    Shovel = $0F39;
    Tool = $1EB8;
    Ingot = $1BF2;
Var
    TotalSwing : Integer;    
    MineSpots : TIntegerList;  

    {end of structure}
                          
    {start of script}    
    
begin
      {create mine spot locations}
      MineSpots := TIntegerList.Create();
        
        {check if depleted vein}
        ClearJournal;
        while InJournal('0007AD00') < 0 do
        begin  
            {look for shovel}
             if FindType(Shovel,Backpack) > 1 then
             begin
                {use shovel}            
                UseObject(FindItem);
                WaitTargetTile(0,1175,1882,4);  
                Wait(1000);                                                
             {look for required ingots}                        
             end else if FindType(Ingot,Backpack) > 6 then
             begin                  
                UseType(Tool,$0000);
                WaitGump('38920ABD');  
                {make tool}
                while Count(Tool) < 2 do
                begin      
                    WaitGump('23');
                    WaitGump('38920ABD');
                    Wait(300);
                end;
                {make shovel}  
                 while Count(Shovel) < 2 do
                begin      
                    WaitGump('72');
                    WaitGump('38920ABD');
                    Wait(300);
                end;
             end;
        end;          
end.

28
Stealth Client / Stealth - Developer or Enduser ?
« on: July 29, 2016, 05:55:00 PM »
Hey guys, I'm completely new to this "Stealth" always thought the only thing to script in was EasyUO, but I like how stealth eats almost no CPU!

I want to learn how to script on this program, keep in mind I'm a complete NOOB. I have Notepad++ installed, but I see everyone with that cool black background program? Also I was wanting to learn how to sccript in Python as I could see as that bing more beneficial for other things then just UO hehe xD. However the best guide and most detailed is Pascal one maybe I should just learn that? Also how do I actually get the scripts to run?

Pages: 1 [2]