Stripped ProjectAlchemy Source Code

12/06/2010 22:04 pro4never#1
<<<NOTE>>>
THIS PROXY IS WRITTEN IN C# AND DOES NOT CONTAIN ANY BOTTING FUNCTIONALITY!
IF YOU WANT IT TO DO ANYTHING YOU WILL NEED TO PROGRAM IT YOURSELF!



For those using my hellmouth source... here's how you can make this proxy log npc scripts/locations for your server ;)

[Only registered and activated users can see links. Click Here To Register...]


If you are not familiar with the C# programming language then I STRONGLY recommend reading this e-book

[Only registered and activated users can see links. Click Here To Register...]

Also if you want more information about packets or proxies then read this thread

[Only registered and activated users can see links. Click Here To Register...]

IF YOU HAVE NOT READ THROUGH THESE TWO THINGS AND/OR DO NOT HAVE A BASIC LEVEL OF PROGRAMMING KNOWLEDGE THEN DON'T EXPECT ANY HELP FROM ME!


So for those who were interested in working on a proxy. Here's the source code to project alchemy with botting functionality, password decryption and speed hack removed.

Don't ask for it with those things added. They no longer exist on my computer.

Basically this is for those who want to learn to make their own bot/proxy but hard time understanding packets/encryption/etc. This is FAR from a perfect proxy (hell, it's not even super stable if you get too many ppl online) but it does work quite nicely as an example.

It's kinda messy atm but w/e.

I left most of the packets in there so you just need to link up the bot thread with your own system of logic to call the packets.


I've left packet handling in there so it SHOULD still work to update most of the local values.

Enjoy!


[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Note: Feel free to release updates to this to help others but I request that you do not simply re-release the entire proxy or claim it as your own.

<edit>

I made the assumption after having worked with so many random pserver sources that setting up something like this would be rather self explanatory... But I suppose I'll make a mini guide here.


Step 1:
Download visual studio or some other C# editor in order to edit the source.
[Only registered and activated users can see links. Click Here To Register...] (express is free, ultimate is super easy to find a key for online)
[Only registered and activated users can see links. Click Here To Register...] (not really used much but another free option)

Step 2:
Install mysql server. Needed to set up the database
[Only registered and activated users can see links. Click Here To Register...] (Full proper version)
[Only registered and activated users can see links. Click Here To Register...] (other version packed in with a bunch of other tools...)

Step 3:
Setup your database using the provided backup. Personally I <3 navicat.
[Only registered and activated users can see links. Click Here To Register...]

Now open up navicat, setup your connection with sql (enter the user/pass setup for it... should be root with no password by default with xampp, full mysql install should request a password)

[Only registered and activated users can see links. Click Here To Register...]


So once you've executed the .sql file that is stored in the upload then you're good to go on that front.

Now you need to modify your settings file in the source.

AlchemyProxy>Bin>Debug>Settings.txt

In this case IP = local ip for where you are hosting the proxy. If you are hosting it off a vps or w/e that will need to be the public up for it but if you are hosting just for yourself you will want to use a hamachi ip or a router ip. NOTE: 127.0.0.1 will dc you!

Now add in the database username, password and database name and you should be good to go!



General Help

When I start up the source I get missing smap errors!!
-This is cause the gamemap.dat is referencing dmaps that don't exist. Just ignore them or modify the gamemap.dat file (yah... doubt most of you know how lol). It shouldn't pose any real issue right now.


I'm lost in the source! How do I add features?!?

Well it's quite simple as basically everything is still added to the proxy.

Currently there is a bot thread setup when a character logs in (everything is super messy but w/e!) which if you open the Handlers>Bot.cs file you will notice the method

NewBot(Client)

this is where you will start your entry into the bot code. You could add things like dropping unwanted items (ores?) or looting/hunting/dc checks! It's all quite simple to code as you have a ton of pre-written useful methods.

Right now almost all of them are packet into the calculations>Distance.cs (late night programming + lazyness made me forget to create new calculation files ahaha)

Main one you'll want to consider is the Distance(x1,y1,x2,y2) method.

It will return an int value measuring the distance between two points. You will use this for almost all bot functionality such as calculating if a mob/loot is in range.

It's also implemented in the OnScreen bool which will tell you if a coord or x/y set are on screen for the character.

Something I never fully finished but you may find incredibly useful is the "PullWeights" method. What it does is returns a list of valid coords on your screen and how close they are to a target location. This will let you easily move towards a target blindly (it's NOT path finding... but it works decently well for blindly calculating a coord near where you want to go)

I MAY release some basic codes for this at some point but I really wanna see some ppl working on some releases for this. I feel it would be good to force some budding coders to LEARN this kind of stuff.
12/07/2010 03:52 Die Schnittstelle#2
Great release.


AntivirusVersionLast UpdateResult
AhnLab-V32010.12.07.002010.12.06-
AntiVir7.10.14.2012010.12.06-
Antiy-AVL2.0.3.72010.12.06-
Avast4.8.1351.02010.12.06-
Avast55.0.677.02010.12.06-
AVG9.0.0.8512010.12.07-
BitDefender7.22010.12.07-
CAT-QuickHeal11.002010.12.06-
ClamAV0.96.4.02010.12.07-
Command5.2.11.52010.12.06-
Comodo69722010.12.06-
DrWeb5.0.2.033002010.12.06-
Emsisoft5.0.0.502010.12.06-
eSafe7.0.17.02010.12.05-
eTrust-Vet36.1.80182010.12.05-
F-Prot4.6.2.1172010.12.06-
F-Secure9.0.16160.02010.12.06-
Fortinet4.2.254.02010.12.06-
GData212010.12.07-
IkarusT3.1.1.90.02010.12.06-
Jiangmin13.0.9002010.12.06-
K7AntiVirus9.70.31742010.12.06-
Kaspersky7.0.0.1252010.12.06-
McAfee5.400.0.11582010.12.07-
McAfee-GW-Edition2010.1C2010.12.06-
Microsoft1.64022010.12.06-
NOD3256802010.12.06-
Norman6.06.102010.12.06-
nProtect2010-12-06.012010.12.06-
Panda10.0.2.72010.12.06-
PCTools7.0.3.52010.12.06-
Prevx3.02010.12.07-
Rising22.76.06.042010.12.06-
Sophos4.60.02010.12.07-
SUPERAntiSpyware4.40.0.10062010.12.06-
Symantec20101.2.0.1612010.12.06WS.Reputation.1
TheHacker6.7.0.1.0962010.12.06-
TrendMicro9.120.0.10042010.12.06-
TrendMicro-HouseCall9.120.0.10042010.12.06-
VBA323.12.14.22010.12.06-
VIPRE75392010.12.06-
ViRobot2010.12.6.41872010.12.06-
VirusBuster13.6.77.02010.12.06-
12/07/2010 04:18 arielbad#3
one make for conquest, pls
12/07/2010 04:21 pro4never#4
NOTHING is added for botting in this. You need to code things yourself. You can't just run it.
12/07/2010 04:27 arielbad#5
helps me encode it, pls man
12/07/2010 04:28 arielbad#6
I do not understand much, even more than this in English
12/07/2010 05:01 pro4never#7
If you can't program you have no reason to be in this thread... this is a BASE not a bot you can just run and use.
12/07/2010 05:34 demon17#8
Can you add the list with the programs what you useded to host and code?

I agree with you at part of your copyright :P at begins when i can i made it for personal uses me and for my brother . Thanx alot
12/07/2010 05:39 tkblackbelt#9
Thanks alot for releasing this I will definitly study the code.

I just read over some of the code and some of it makes sense but in the password class I got kinda mindfucked lol how did you come up with the password encryption and decryption?
12/07/2010 06:12 phelpsbaptistella#10
i dont have idea how to make it :|
but nice post, will help some peoples :]
12/07/2010 07:19 pro4never#11
Quote:
Originally Posted by demon17 View Post
Can you add the list with the programs what you useded to host and code?

I agree with you at part of your copyright :P at begins when i can i made it for personal uses me and for my brother . Thanx alot
Ummm...


Sql for the database
Visual studio 2010 ultimate for coding (express works fine but it's easy enough to pirate lol)
Navicat for a gui database tool just to easily browse/modify the db


That's it really... it's just C# + some db functionality, most of which was removed from this as I removed password decryption.

Quote:
Originally Posted by tkblackbelt View Post
Thanks alot for releasing this I will definitly study the code.

I just read over some of the code and some of it makes sense but in the password class I got kinda mindfucked lol how did you come up with the password encryption and decryption?

That's cause I removed a bunch of the password crypt stuff. You need the password seed sent + a bunch of other stuff... the password crypt in there I don't even remember most of lol.
12/07/2010 07:22 pro4never#12
Here's something to hopefully spark some releases by you guys...

Simple method to return the closest monster to you...


public static Mob GetClosestMonster(Client C)
{
Mob ToReturn = null;
int Dist = 18;
foreach(Mob M in C.LocalMobs.Values)
{
if(Distance(C.X, C.Y, M.X, M.Y) < Dist)
{
ToReturn = M;
Dist = Distance(C.X, C.Y, M.X, M.Y);
if (Dist < 2)
break;
}
}
return ToReturn ;
}

I'm sure I typo'd some of that... it's all just from memory lol.

It's REALLY simple to add in botting functionality seeing as everything is already updated for you such as reading your coords, local mobs, local items and that kinda stuff...
12/07/2010 12:29 vecko12#13
Quote:
Originally Posted by pro4never View Post
Here's something to hopefully spark some releases by you guys...

Simple method to return the closest monster to you...


public static Mob GetClosestMonster(Client C)
{
Mob ToReturn = null;
int Dist = 18;
foreach(Mob M in C.LocalMonsters.Keys)
{
if(Distance(C.X, C.Y, M.X, M.Y) < Dist)
{
ToReturn = M;
Dist = Distance(C.X, C.Y, M.X, M.Y);
if (Dist < 2)
break;
}
}
return ToReturn ;
}

I'm sure I typo'd some of that... it's all just from memory lol.

It's REALLY simple to add in botting functionality seeing as everything is already updated for you such as reading your coords, local mobs, local items and that kinda stuff...
I think it should be:
public static Mob GetClosestMonster(Client C)
{
Mob ToReturn = null;
int Dist = 18;
foreach(Mob M in C.LocalMobs.Keys)
{
if(Distance(C.X, C.Y, M.X, M.Y) < Dist)
{
ToReturn = M;
Dist = Distance(C.X, C.Y, M.X, M.Y);
if (Dist < 2)
break;
}
}
return ToReturn ;
}

<Edit> I have no Idea how to make this botting code :)
12/07/2010 13:15 denominator#14
I had a mess around with this earlier or at least tried to >.< I assume logging into account server is working but not logging into the actual game itself?
12/07/2010 14:24 demon17#15
P4N can you make a little tut how to ?:P I have all programs but i get stuck at some parts :P