Habbo Development Forums
Welcome To Habbo Development Forums, It Apears You Are Not Logged In Or Registerd If You Want The Full Features Of Habbo Development Forums Please Log In Or Register.

[Corpse] Coding For Noobs + Dugs Code [Corpse]

Go down

PhpBB3 [Corpse] Coding For Noobs + Dugs Code [Corpse]

Post by Corpse on Sun Oct 03, 2010 6:02 pm

Ok, Many of my friends have been bothering me on how to code and seeing as, no offence, but theres not many good TuT's for beginners, I've decided to make my own, This TUT only teaches you how to code at a beginner level, simple commands, to become more experienced and a better coder, read up on other codes and try and understand and toggle with them. Lets Begin.

Ok, Before Coding, You can either use Microsoft C# or Notepad, I Highly Recommened Microsoft C# For beginners
1) As It Tidys Your Code Up
2) Once your done, you can debug for errors.

Download

The Basics, Beginning

Ok, When beginning a code, it always starts with
#region "(command name)": without brackets, so lets say
#region :drugs
That would be the first line of your code, and the first line of your code always starts with #region as long as it is the command not getting into private voids and other complicated stuff.

After succesfully writing the first line of your code and about 7 words, we move onto the case
case "(what are you talking about)": so erm
case "weed":
this can be changed subject to what the command is about, like this command is :drugs and this drug is weed. Make sure to always leave the "" in while doing case.

Ok well, we are past the easy part, now onto the main code.

The Middle, What does it do?

Ok so our code, our well the example code so far is,
#region :drugs
case "weed":
which is fine at the moment, now we have to make the command actually do something, here are some simple command lines and what they do.

sendData("BK" + ""); - Sends a little pop up saying something, like when you say :stats, or that afk workout thing. But to get things like your str, hp and stuff like that you would have to string it, which is a little more advanced.

Room.sendShout(roomUser, ""); - Sends a shout message to the whole room, like wen u hit someone. but again, hit is more advanced

Room.sendWhisper(roomUser, "
if (_roomID != ) - makes something only work in a specific room

These are just simple codes used in most commands, make sure that you know how to use brackets and where they go, as i seriously cba to explain here.


The End, Finishing Up?

After you have added some lines of code for it to do, you should always end by finalizing the brackets and making sure they cancel each other out, after that type
break; - then
#endregion


Finished, Simple Command
PHP Code:
#region :smoke
case "weed":
{
Room.sendSaying(roomUser, "*Brings out a leaf wrapped in paper, lights then inserts into mouth and smokes*");
Room.sendSaying(roomUser, "*Loses balance*");
User.sendData("BK" + "Dont go to far with the green stuff!");
break;
}
#endregion
This is one of the simplest codes you can find, read up on it, try and figure out what it does and toggle with it.

Here is a more enhanced version of this code for users who known more than this.

PHP Code:
#region :smoke
case "weed":
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
dbClient.runQuery("UPDATE users SET health = health - '35' WHERE name = '" + _Username + "'");
dbClient.runQuery("UPDATE users SET credits = credits - '250' WHERE name = '" + _Username + "'");
Room.sendSaying(roomUser, "*Brings out a leaf wrapped in paper, lights then inserts into mouth and smokes*");
_Mission = "[Intoxicated] High";
Room.sendSaying(roomUser, "*Loses balance*");
this.statusManager.containsStatus("lay");
User.sendData("BK" + "Dont go to far with the green stuff! Your losing your hp and credits!");
}
break;
}
#endregion
--- Edit --- Thanks To Cobe For Making You Drop After getting high

I Would Make It To Add Str And Reduce Back After A Limited Amount Of Time, But It Would Probably Confuse The Nubs With iCount and *****.

Feel free to use my smoke command, update it, and post here thank me though and give credits, though i know you wont xD

Feel Free To Ask Questions

Well, Thanks, I Hoped I Helped
And If I Did

Press that "thanks" button

Xavi.
__________________
PHP Code:
...{
sendData("BK" + "Sorry, your too fat, lower some carbs, or buy VIP.");
}...

http://tinyurl.com/easycoding - Learn To Code + Thank Me Very Happy

Ok, Many of my friends have been bothering me on how to code and seeing as, no offence, but theres not many good TuT's for beginners, I've decided to make my own, This TUT only teaches you how to code at a beginner level, simple commands, to become more experienced and a better coder, read up on other codes and try and understand and toggle with them. Lets Begin. Ok, Before Coding, You can either use Microsoft C# or Notepad, I Highly Recommened Microsoft C# For beginners 1) As It Tidys Your Code Up 2) Once your done, you can debug for errors. Download Download Visual C# 2008 Express Edition, Visual C# 2008 Express Edition Download The Basics, Beginning Ok, When beginning a code, it always starts with #region "(command name)": without brackets, so lets say #region :drugs That would be the first line of your code, and the first line of your code always starts with #region as long as it is the command not getting into private voids and other complicated stuff. After succesfully writing the first line of your code and about 7 words, we move onto the case case "(what are you talking about)": so erm case "weed": this can be changed subject to what the command is about, like this command is :drugs and this drug is weed. Make sure to always leave the "" in while doing case. Ok well, we are past the easy part, now onto the main code. The Middle, What does it do? Ok so our code, our well the example code so far is, #region :drugs case "weed": which is fine at the moment, now we have to make the command actually do something, here are some simple command lines and what they do. sendData("BK" + ""); - Sends a little pop up saying something, like when you say :stats, or that afk workout thing. But to get things like your str, hp and stuff like that you would have to string it, which is a little more advanced. Room.sendShout(roomUser, ""); - Sends a shout message to the whole room, like wen u hit someone. but again, hit is more advanced Room.sendWhisper(roomUser, ") - makes something only work in a specific room These are just simple codes used in most commands, make sure that you know how to use brackets and where they go, as i seriously cba to explain here. The End, Finishing Up? After you have added some lines of code for it to do, you should always end by finalizing the brackets and making sure they cancel each other out, after that type break; - then #endregion Finished, Simple Command PHP Code: #region :smoke case "weed": { Room.sendSaying(roomUser, "*Brings out a leaf wrapped in paper, lights then inserts into mouth and smokes*"); Room.sendSaying(roomUser, "*Loses balance*"); User.sendData("BK" + "Dont go to far with the green stuff!"); break; } #endregion This is one of the simplest codes you can find, read up on it, try and figure out what it does and toggle with it. Here is a more enhanced version of this code for users who known more than this. PHP Code: #region :smoke case "weed": { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE users SET health = health - '35' WHERE name = '" + _Username + "'"); dbClient.runQuery("UPDATE users SET credits = credits - '250' WHERE name = '" + _Username + "'"); Room.sendSaying(roomUser, "*Brings out a leaf wrapped in paper, lights then inserts into mouth and smokes*"); _Mission = "[Intoxicated] High"; Room.sendSaying(roomUser, "*Loses balance*"); this.statusManager.containsStatus("lay"); User.sendData("BK" + "Dont go to far with the green stuff! Your losing your hp and credits!"); } break; } #endregion --- Edit --- Thanks To Cobe For Making You Drop After getting high I Would Make It To Add Str And Reduce Back After A Limited Amount Of Time, But It Would Probably Confuse The Nubs With iCount and *****. Feel free to use my smoke command, update it, and post here thank me though and give credits, though i know you wont xD Feel Free To Ask Questions Well, Thanks, I Hoped I Helped And If I Did Press that "thanks" button Xavi. __________________ PHP Code: ...{ sendData("BK" + "Sorry, your too fat, lower some carbs, or buy VIP."); }... http://tinyurl.com/easycoding - Learn To Code + Thank Me Very Happy


Credits
Xavi. 89% Tutorial and Code
Corpse 11% Edited Tut, finding and uploading it to here.
avatar
Corpse

Posts : 20
Join date : 2010-06-27
Location : England, North East

View user profile

Back to top Go down

PhpBB3 Re: [Corpse] Coding For Noobs + Dugs Code [Corpse]

Post by Goofy on Fri Mar 11, 2011 4:36 pm

OMFG! Thanks for showing me how to code so i dont have to steal others that i dont know how to edit lol so thanks i realy appreciate it (:
avatar
Goofy

Posts : 3
Join date : 2011-03-11
Age : 27
Location : Ohio, United States

View user profile

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum