| Code academy | |
|
+3fr3nchfry BillieJoe67 MonkeyBoy 7 posters |
Author | Message |
---|
MonkeyBoy Full Moderator + Donator
Posts : 1418 Join date : 2009-03-06 Age : 31 Location : England
| Subject: Code academy Wed Oct 30, 2013 10:59 pm | |
| I want to learn to code so i can help this website if needed and also it would be great for my career seeing as im gonna be designing games for a living one day. ive found a website which teaches code for free, so id like to know what type of code we use here for the server so i can learn it :) kthnxbai | |
|
| |
BillieJoe67 Full Moderator
Posts : 547 Join date : 2012-04-15 Age : 28
| Subject: Re: Code academy Wed Oct 30, 2013 11:16 pm | |
| The server runs C++, BRenBot is perl (eww) Feel free to pm me if you want help with anything 8) EDIT: I learnt python first using this, then went to C++. Python 3.3.2: http://www.python.org/download/releases/3.3.2/ (you'll probably need the Windows x86 msi installer) To start a new script, Start->Programs->Python 3.3->IDLE (Gui) will bring up an interactive session so you can prototype stuff; the easiest thing I can think of is (take care with indenting, as I'm sure you'll find out) - Code:
-
def say_hi(): print("Hello world!")
say_hi()
Not wanting to scare you, but this is a part of a project I've been working on in my free time (a Python port of ssgm), just to show you what you can achieve with python. Remember, if you're not sure, google is your friend
Last edited by BillieJoe67 on Wed Oct 30, 2013 11:33 pm; edited 2 times in total | |
|
| |
MonkeyBoy Full Moderator + Donator
Posts : 1418 Join date : 2009-03-06 Age : 31 Location : England
| Subject: Re: Code academy Wed Oct 30, 2013 11:19 pm | |
| damn neither of those are on the list of codes on this website if you can find a website that teaches that stuff for free then let me know | |
|
| |
BillieJoe67 Full Moderator
Posts : 547 Join date : 2012-04-15 Age : 28
| Subject: Re: Code academy Wed Oct 30, 2013 11:20 pm | |
| I updated my first post as you typed that xD | |
|
| |
MonkeyBoy Full Moderator + Donator
Posts : 1418 Join date : 2009-03-06 Age : 31 Location : England
| Subject: Re: Code academy Wed Oct 30, 2013 11:24 pm | |
| schweet. i heard python is a relatively easy one, with c++ the stuff of pros. oh well ill have to learn it eventually anyway, ill start tomorrow! thanks billie!
8 | |
|
| |
BillieJoe67 Full Moderator
Posts : 547 Join date : 2012-04-15 Age : 28
| Subject: Re: Code academy Wed Oct 30, 2013 11:34 pm | |
| I updated it again with a script I find easy to understand but will make you cry, just because of that 8 <3 | |
|
| |
fr3nchfry Full Moderator + Donator
Posts : 156 Join date : 2013-05-29 Age : 31
| Subject: Re: Code academy Thu Oct 31, 2013 3:17 am | |
| I thought I remembered my TA saying that python was pretty pointless? | |
|
| |
Denos Full Moderator
Posts : 762 Join date : 2011-06-03 Age : 33 Location : Tennessee, USA
| Subject: Re: Code academy Thu Oct 31, 2013 6:08 am | |
| i would cry trying to learn code/scripting, looks SO complicated xD | |
|
| |
Menorya Administrator
Posts : 662 Join date : 2008-01-20 Location : Germany/Hungary
| Subject: Re: Code academy Thu Oct 31, 2013 10:45 am | |
| I want to learn it too! I aready learned C++ when I was in the web-programming school but mh.. Billie teach me too plz! | |
|
| |
BillieJoe67 Full Moderator
Posts : 547 Join date : 2012-04-15 Age : 28
| Subject: Re: Code academy Thu Oct 31, 2013 11:17 am | |
| - fr3nchfry wrote:
- I thought I remembered my TA saying that python was pretty pointless?
I use it for the bulk of whatever I do since it's a simple syntax, but you can do whatever the hell you like with it. Out of curiosity, which languages does your TA use? For me at least, Python is like a one size fits all since you can run it on pretty much any platform, and you can use it for web content (Google is pretty much based on Python these days) | |
|
| |
BillieJoe67 Full Moderator
Posts : 547 Join date : 2012-04-15 Age : 28
| Subject: Re: Code academy Thu Oct 31, 2013 11:32 am | |
| | |
|
| |
fr3nchfry Full Moderator + Donator
Posts : 156 Join date : 2013-05-29 Age : 31
| Subject: Re: Code academy Thu Oct 31, 2013 5:26 pm | |
| I'm pretty sure he knows many programming languages, as he graduated with a computer science degree, and he had been programming since he was 7. So far i've learned only Java but I am definitely going to expand soon. Java, being object oriented, if I can remember correctly he said is more widely used because python uses its code and then basically throws it away, and cant call on its older methods. I was probably inaccurate saying that python was useless but maybe I should say programming languages such as Java and C++ are more obviously more useful, since even many non-programmers have seen the names lying around. | |
|
| |
BillieJoe67 Full Moderator
Posts : 547 Join date : 2012-04-15 Age : 28
| Subject: Re: Code academy Thu Oct 31, 2013 5:45 pm | |
| I've never really touched Java so I can't really comment on it, but I've managed to do everything I've ever needed using a blend of C++ and Python. Python is definitely object orientated; not sure what you mean by throwing code away or not being able to call on older methods. You might be referring to the syntax changes between 2.x and 3.x (print becoming a function rather than a statement, etc). You are kinda correct though, Python is definitely more of a scripting language rather than a programming language, but it's a damn useful one for prototyping algorithms, or even using to create whole programs (Blender, for example). Another reason I love Python is because it's dynamically typed, so you can create structures based on data unknown at the time of writing (contents of an sqlite table, or JSON data). That Python interpreter on code academy is actually quite good :p - Code:
-
print "Welcome to Python!"
class _metaclass(type): def __new__(metaclass, name, bases, attrs): print "Creating new object type %s"%(name) attrs['noobs'] = 4 return super( _metaclass, metaclass).__new__( metaclass, name, bases, attrs) class Blub(object): __metaclass__ = _metaclass def __init__(self, *args): if not args: print "I have no arguments" else: print "I have %d arguments"%(len(args)) def main(): print "Creating Blubs" b = Blub() d = Blub(*range(1,4)) print "b has {0} noobs".format(b.noobs) main() - Quote :
Welcome to Python! Creating new object type Blub Creating Blubs I have no arguments I have 3 arguments b has 4 noobs C++ is always interesting to learn, no matter how experienced you are with any other language ^.^ | |
|
| |
KicsiSajt Administrator
Posts : 449 Join date : 2008-01-20 Age : 33 Location : Hungary
| Subject: Re: Code academy Thu Oct 31, 2013 6:06 pm | |
| C++ only not enough for server o; you need learn some assembly to and using memory writes o; like serial hooks - Code:
-
extern "C" __declspec(dllexport) void RequestSerial(int ID, StringClass &_str) { __asm { mov eax, 6B8h; push eax;
mov eax, 0x672410; call eax;
add esp, 4;
mov ecx, eax; push ecx;
mov eax, 0x4B7220; call eax;
pop ecx;
mov eax, _str; push eax;
mov eax, ID; push ID;
mov eax, 0x4B72C0; call eax; } }
cuz with assembly hooks could create alot awesome things o; | |
|
| |
BillieJoe67 Full Moderator
Posts : 547 Join date : 2012-04-15 Age : 28
| Subject: Re: Code academy Thu Oct 31, 2013 6:12 pm | |
| Pfft, I can do that with python (easily if I wanted 2 sfps, or a harder way which have the same overhead as kicsi's hook) :p Edit: just looked through that code and that's not even a hook ;p This is how I would get a player's serial (haven't checked that the addresses, classes and offsets are still valid) - Code:
-
class RemoteHost(ctypes.Structure): _fields_ = [ ("_padding0000", ctypes.c_char*0x380), ("version", ctypes.c_float), ("serial", ctypes.c_char*33) ]
class Connection(ctypes.Structure): _fields_ = [ ("_padding0000", ctypes.c_char*0x548), ("remote_hosts", ctypes.POINTER(ctypes.POINTER(RemoteHosts))), ("_padding054C" ctypes.c_char*0x44) ]
class Network(object): # this is a static attribute _PServerConnection = ctypes.cast(0x0081FF84, ctypes.POINTER(Connection))
def get_serial(client_id): # obviously, I wouldn't normally split it up like this # for C++ users, .contents dereferences the pointer connection = Network._PServerConnection remote_host = connection.contents.remote_host[client_id] serial = remote_host.contents.serial return serial
Last edited by BillieJoe67 on Thu Oct 31, 2013 6:38 pm; edited 4 times in total | |
|
| |
[-HOH-]Mikey Donator
Posts : 1084 Join date : 2009-10-30 Age : 31 Location : The land of Oz
| Subject: Re: Code academy Thu Oct 31, 2013 6:21 pm | |
| - KicsiSajt wrote:
- C++ only not enough for server o;
you need learn some assembly to and using memory writes o;
like serial hooks - Code:
-
extern "C" __declspec(dllexport) void RequestSerial(int ID, StringClass &_str) { __asm { mov eax, 6B8h; push eax;
mov eax, 0x672410; call eax;
add esp, 4;
mov ecx, eax; push ecx;
mov eax, 0x4B7220; call eax;
pop ecx;
mov eax, _str; push eax;
mov eax, ID; push ID;
mov eax, 0x4B72C0; call eax; } }
cuz with assembly hooks could create alot awesome things o; Trust kicsi, he code hax | |
|
| |
KicsiSajt Administrator
Posts : 449 Join date : 2008-01-20 Age : 33 Location : Hungary
| Subject: Re: Code academy Thu Oct 31, 2013 6:46 pm | |
| nah... ill just show u the speed hooks - Code:
-
void SetMaxSpeed(GameObject *o, float speed) { _asm { mov ebx, 0x006C8F20 mov ecx, o push speed call ebx } } | |
|
| |
BillieJoe67 Full Moderator
Posts : 547 Join date : 2012-04-15 Age : 28
| Subject: Re: Code academy Thu Oct 31, 2013 6:49 pm | |
| Why not just use void SoldierGameObj::Set_Max_Speed(float Speed)? It's virtual so you don't even need a definition to use it | |
|
| |
fr3nchfry Full Moderator + Donator
Posts : 156 Join date : 2013-05-29 Age : 31
| Subject: Re: Code academy Fri Nov 01, 2013 12:28 am | |
| Lol I probably should not have said anything the last week of class when he touched on python wasn't on the exam so... | |
|
| |
fr3nchfry Full Moderator + Donator
Posts : 156 Join date : 2013-05-29 Age : 31
| Subject: Re: Code academy Mon Nov 04, 2013 5:38 am | |
| - BillieJoe67 wrote:
- Another reason I love Python is because it's dynamically typed, so you can create structures based on data unknown at the time of writing (contents of an sqlite table, or JSON data).
What exactly does this mean? Like command line or user input data will fill the structures? | |
|
| |
Sponsored content
| Subject: Re: Code academy | |
| |
|
| |
| Code academy | |
|