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

Pages: [1]
1
Stealth Client / [C#] send texts
« on: December 10, 2017, 08:03:12 PM »
Hello everyone!
I did some research and found some code to send text messages, after some reworking, I wrote this class.
figured i would share what i have learned.

Code: [Select]
using System;
using System.Net;
using System.Net.Mail;

namespace Hunter
{
    public class Communicator
    {
        private string _sender;
        private string _password;
        private long _telephoneNumber;
        private string _gateWay;
        private string _recipient;

        //list of gateways
        //https://en.wikipedia.org/wiki/SMS_gateway

        public Communicator(string sender, string password, long telephoneNumber, string gateWay)
        {
            _sender = sender;
            _password = password;
            _telephoneNumber = telephoneNumber;
            _gateWay = gateWay;
            _recipient = string.Concat(new object[] { _telephoneNumber, '@', _gateWay });
        }

        public void sendTxtMsg(string subject, string message)
        {
            using (MailMessage textMessage = new MailMessage(_sender, _recipient, subject, message))
            {
                using (SmtpClient textmessageClient = new SmtpClient("smtp.gmail.com", 587))
                {
                    textmessageClient.UseDefaultCredentials = false;
                    textmessageClient.EnableSsl = true;
                    textmessageClient.Credentials = new NetworkCredential(_sender, _password);
                    Console.WriteLine("attempting to send sms...");
                    textmessageClient.Send(textMessage);
                }
            }
        }
    }
}

I made a separate gmail account and configured the account to "Let less secure apps use your account"
So when you make the communicator object, do something like this
Code: [Select]
Communicator textSender = new Communicator("SeperateEmail@gmail.com", "passWrdToSeperateEmail", 1238675309, "gatewayToCellCarrier.com");
textSender.sendTxtMsg("[TEST]","Testing...");
The first parameter is the new email that was created that is SENDING the msg
The second parameter is the password to the newly created email
The third parameter is the phone number that you want to receive the texts
The fourth parameter is the gateway. a list of gateways can be found in the class above.

2
Stealth Client / c# and multi-threading
« on: December 07, 2017, 07:32:43 PM »
im back with another question!
So i have been messing around with multi-threading with a hunter script for stealth. I have an autoHealer thread, and a monsterAttacker thread. Im having problems with the two not working together. If my character starts getting low on health, he will stop attacking the monster(I pause the monster attacker thread), but when i get healed back to full health and resume the monster attacker thread, i start attacking myself ( I have died many times haha). suggestions? Im thinkin multi-threading is not the way to go  :\'(

3
Stealth Client / [c# and scriptSDK] looting
« on: November 25, 2017, 11:00:05 PM »
Hello again!!!
I have a very interesting project that starting to really come together! I am having a real issue with looting certain items from containers (corpses or secures)
does anyone have a class or some examples for looting?
p.s. sorry for 2 posts in a row.


update:
ok after spending a lot of time on this, this is what i have found from my own script, and drabadans autokiller:
so it looks like drabadan uses this event handler to loot the container.
Code: [Select]
        private async void Client_DrawContainer(object sender, DrawContainerEventArgs e)
        {
            if(e.ModelGump == 9)
            {
                await Loot(e.ContainerId);
            }
        }

down in loot the loot function is where im running into issues...
Code: [Select]
        private async Task Loot(uint corpseId)
        {
            Stealth.Client.FindTypeEx(0xFFFF, 0xFFFF, corpseId, true);
            var itemsFound = Stealth.Client.GetFindList();

            foreach(var item in itemsFound)
            {
                bool transfer = false;
                if (LootTypes.Contains(Stealth.Client.GetType(item)))
                {
                    transfer = true;
                }

                if (!transfer)
                {
                    var tooltip = Stealth.Client.GetTooltip(item);
                    foreach(var tooltipValue in LootTooltipValues)
                    {
                        if (tooltip.ToLower().Contains(tooltipValue.ToLower()))
                        {
                            transfer = true;
                            break;
                        }
                    }
                }

                if(transfer)
                {
                    ct = new CancellationTokenSource();
                    _currMovingItem = item;
                    await Task.Delay(1000);
                   
                    //Does not really seem to move items...
                    Stealth.Client.MoveItem(item, 0, _backpackId, 0, 0, 0);
                    try
                    {
                        await Task.Delay(5000, ct.Token);
                    }
                    catch (TaskCanceledException) { }
                }
            }

            lootingQueue.Remove(corpseId);
        }


4
Stealth Client / sending a parameter to a form
« on: November 25, 2017, 06:07:59 PM »
Hey there!!!!
So I have been dissecting Drabadan's Auto killer script, and it looks amazing!!! ive been basing my own project off of this script! i do have two questions that i cant really figure out on my own. throughout the script Drabadan sends Action<string> messanger around to a lot of different places.

My questions:
1) What is the Action<string> messanger accomplishing.
2) It appears the shell constructor is taking a parameter... Where is that getting sent from?
 
Code: [Select]
public Shell(Action<string> messanger)
        {
            InitializeComponent();
            _messanger = messanger;
        }

5
Stealth Client / mobile proximity
« on: June 29, 2016, 05:24:26 PM »
Hello! i feel like a crazy person with all these posts I be posting hehe. Anyways, I am working on something that will auto wither
heres my code:

Code: [Select]
for (int i = 0; i < Rail.Count(); i++)
            {
                if (Player.Hits != Player.MaxHits)
                {
                    healSelf(Player);
                }
                advancePosition(Player, Rail.ElementAt(i));
                SDK.Initialize();
                Stealth.Client.SetFindDistance(2);
                Stealth.Client.SetFindVertical(0);
                somethings = Scanner.Find<Something>(0x0, false).OrderBy(x => x.Distance).ToList();
                foreach (Something m in somethings)
                {
                   Player.Cast("Wither");
                   Thread.Sleep(1000);
                   if (Player.Hits != Player.MaxHits)
                   {
                      healSelf(Player);
                   }
                }
                if(somethings.Count == 0)
                {
                    continue;
                }
            }

dont judge if this is terribly wrong! im learning =]

6
Stealth Client / [C#] rails
« on: June 24, 2016, 07:11:35 AM »
Hello!
So im working on rails now. Ive manually walked the rail and recorded character X, Y, and Z locations in a .txt file. Looks like this:
5924,2024,1
5924,2018,3
5917,2011,1
5917,2000,4
5917,1900,4
5917,1979,2
5914,1893,0//click something at this location
and on and on.
Now i need to figure out how to actually walk the rail and click the things when it gets to that location. What is the recommended way to do this?

7
Stealth Client / pathfinding
« on: June 09, 2016, 06:09:21 PM »
hi all! any ideas on the best way to pathfind? Im working on an npc scanner type thing, and some of the npc's I need to find are in houses. This is what i have so far, and im getting 0's for the co-ordinates.

Code: [Select]
        static void moveToNpc(PlayerMobile P, Mobile target, ushort locX, ushort locY, sbyte locZ)
        {
            //Stealth.Client.newMoveXY(locX, locY, true, 0, true);
            //Stealth.Client.MoveXYZ(locX, locY, locZ, 1, 1, true);
            //P.Movement.MoveXYZ(locX, locY, locZ, 1, 1, true);
            MovingHelper moveToTarg = MovingHelper.GetMovingHelper();
            moveToTarg.AutoOpenDoors = true;
            List<MyPoint> path = moveToTarg.GetPathArray(locX, locY, true, 2);
            foreach(MyPoint point in path)
            {
                P.Movement.MoveXYZ(point.X, point.Y, (sbyte)point.Z, 0, 0, true);
               
            }
        }


Post Merge: June 10, 2016, 09:05:15 PM
updated my code
Code: [Select]
        static void moveToNpc(PlayerMobile P, Mobile target, ushort locX, ushort locY, sbyte locZ)
        {
            MovingHelper moveToTarg = MovingHelper.GetMovingHelper();
            moveToTarg.AutoOpenDoors = true;
            List<MyPoint> path = moveToTarg.GetPathArray(locX, locY, true, 1);
            if (path.Count() < 1)
                ErrorExit("no path has been created to npc");
            foreach(MyPoint point in path)
            {
                Console.WriteLine("pointX: " + point.X + " " + "pointY: " + point.Y);
                if (point.X == 0 || point.Y == 0)
                {
                    moveToTarg.SetBadLocation(point.X, point.Y);
                    break;
                }
                moveToTarg.MoveXYZ(point.X, point.Y, (sbyte)point.Z, 0, 0, true);
            }
        }

still not working, but I added the console.writeline so i could see what kind of points I was getting. The points in path are valid, except for the last Y location is 0. So that messes it up somewhere. Also my character wont move... Im not sure if im doing something wrong...

8
Stealth Client / context menu crash
« on: June 03, 2016, 02:37:04 PM »
I also too as well am having context menu problems. My code looks like dis:

Code: [Select]
static void exitEncounter(PlayerMobile P)
        {
            Console.WriteLine("Exiting encounter");
            ScriptSDK.Configuration.ContextOptions.Initialize();
            P.ContextMenu.Parse();
           
            //P.ContextMenu.Click("Exit Shadowguard");
            // or
            //P.ContextMenu.Click(1156287);//or some number like that...
        }

any ContextMenu.Click line gives me a weird error.
Error in IdServer: "Access Violation at address 0052AD65 in module 'Stealth.Exe'. Read of address 00000025"

9
Stealth Client / client dll troubles
« on: May 27, 2016, 01:27:37 PM »
Hello all! i hope this is the correct place to post this. I am new to stealth, and im currently working on writing some c# stuff for it. Im dealing with a gump at the moment and was looking at how to get info on the gump. From what ive seen, I have to use the clientdll thing. Well the only way i can get my client to stay open is if i uncheck use dll in the configuration menu under the server tab in stealth. When checked, my client crashes immediately.

what im running:
stealth 7.4.0
client version 7.0.49.69 (dunno if you need that)
windows 10

10
New member introductions / Well Hello there!
« on: May 23, 2016, 09:09:27 PM »
Hello everyone!
My name on the forum is smitty, but my main character name is often Chaos. I play over on Lexia with Hitech. We are both challenging ourselves to build stronger better faster scripts.

a little about myself:
I have a bachelors degree in fine art. My concentration is in sculpture with a minor in painting. All of my sculptures were kinetic and powered by an Arduino. Eventually i found myself enjoying writing code for the arduino more than i enjoyed making the sculptures themselves! About 3 years after graduating with my bachelor degree in fine art, I realize that spending all my time on that degree was useless and dumb... So now i'm going back to school for a bachelor of computer science degree!
I have played uo for a long long time. For the majority of the time i was on chessapeak (sp?). I was involved in a vampire role playing guild... Those were the days tehe. Uo started dieing as soon as world of warcraft came out, so of course i had to go check that out... for a couple of years. For the past 700 some odd days, Ive been on Alexandria with hitech! Alexandria has been a never ending fountain of knowledge for my scripting abilities! Sadly, most of my scripts are not for the public... One reason i never release any of my scripts is because mysteriously, all of my click co-ords are different than everyone elses! I have no clue why, and neither does anyone that i have asked.
Much like hitech, Ive scripted my own master / slave script. I run 3 mage / necro / weavers. Lately though i have been running around on a wraith thrower. MAN that is a fun character to play!

Welp i think thats about it! If anyone has any questions please feel free to pm me!

Pages: [1]