Welcome to our forums! Please login or register to get access to all our forums!
Welcome to our forums! Please login or register to get access to all our forums!
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomePortalSearchRegisterLog in

 

 Code academy

Go down 
+3
fr3nchfry
BillieJoe67
MonkeyBoy
7 posters
AuthorMessage
MonkeyBoy
Full Moderator + Donator
Full Moderator + Donator



Posts : 1418
Join date : 2009-03-06
Age : 31
Location : England

Code academy Empty
PostSubject: Code academy   Code academy EmptyWed 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
Back to top Go down
BillieJoe67
Full Moderator



Posts : 547
Join date : 2012-04-15
Age : 28

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyWed 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
Back to top Go down
MonkeyBoy
Full Moderator + Donator
Full Moderator + Donator



Posts : 1418
Join date : 2009-03-06
Age : 31
Location : England

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyWed Oct 30, 2013 11:19 pm

damn neither of those are on the list of codes on this website Razz if you can find a website that teaches that stuff for free then let me know
Back to top Go down
BillieJoe67
Full Moderator



Posts : 547
Join date : 2012-04-15
Age : 28

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyWed Oct 30, 2013 11:20 pm

I updated my first post as you typed that xD
Back to top Go down
MonkeyBoy
Full Moderator + Donator
Full Moderator + Donator



Posts : 1418
Join date : 2009-03-06
Age : 31
Location : England

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyWed 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
Back to top Go down
BillieJoe67
Full Moderator



Posts : 547
Join date : 2012-04-15
Age : 28

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyWed 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
Back to top Go down
fr3nchfry
Full Moderator + Donator
Full Moderator + Donator



Posts : 156
Join date : 2013-05-29
Age : 31

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu Oct 31, 2013 3:17 am

I thought I remembered my TA saying that python was pretty pointless?
Back to top Go down
Denos
Full Moderator
Denos


Posts : 762
Join date : 2011-06-03
Age : 33
Location : Tennessee, USA

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu Oct 31, 2013 6:08 am

i would cry trying to learn code/scripting, looks SO complicated xD
Back to top Go down
Menorya
Administrator
Menorya


Posts : 662
Join date : 2008-01-20
Location : Germany/Hungary

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu 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.. cherry 
Billie teach me too plz! What a Face 
Back to top Go down
BillieJoe67
Full Moderator



Posts : 547
Join date : 2012-04-15
Age : 28

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu 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)
Back to top Go down
BillieJoe67
Full Moderator



Posts : 547
Join date : 2012-04-15
Age : 28

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu Oct 31, 2013 11:32 am

Python tutorials:
https://www.youtube.com/watch?v=4Mf0h3HphEA&list=PL4E68ACF14ABB47AC
http://files.swaroopch.com/python/byte_of_python.pdf
http://www.alan-g.me.uk/l2p/index.htm

C++ tutorials:
https://www.youtube.com/watch?v=tvC1WCdV1XU&list=PLAE85DE8440AA6B83
https://www.youtube.com/playlist?list=PL2F919ADECA5E39A6

The best way to get used to writing code and figuring out how to solve a problem is to read other people's code, then think of something that you'd like to make and build up to it by googling any questions, and taking it one line at a time. Obviously, you can only do that once you are used writing simple stuff and understanding how it works
Back to top Go down
fr3nchfry
Full Moderator + Donator
Full Moderator + Donator



Posts : 156
Join date : 2013-05-29
Age : 31

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu 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.
Back to top Go down
BillieJoe67
Full Moderator



Posts : 547
Join date : 2012-04-15
Age : 28

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu 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 ^.^
Back to top Go down
KicsiSajt
Administrator
KicsiSajt


Posts : 449
Join date : 2008-01-20
Age : 33
Location : Hungary

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu 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;
Back to top Go down
BillieJoe67
Full Moderator



Posts : 547
Join date : 2012-04-15
Age : 28

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu 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
Back to top Go down
[-HOH-]Mikey
Donator
[-HOH-]Mikey


Posts : 1084
Join date : 2009-10-30
Age : 31
Location : The land of Oz

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu 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
Back to top Go down
KicsiSajt
Administrator
KicsiSajt


Posts : 449
Join date : 2008-01-20
Age : 33
Location : Hungary

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu Oct 31, 2013 6:46 pm

nah... ill just show u the speed hooks Razz

Code:
void SetMaxSpeed(GameObject *o, float speed)
{
 _asm {
 mov ebx, 0x006C8F20
 mov ecx, o
 push speed
 call ebx
 }
}
Back to top Go down
BillieJoe67
Full Moderator



Posts : 547
Join date : 2012-04-15
Age : 28

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyThu 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
Back to top Go down
fr3nchfry
Full Moderator + Donator
Full Moderator + Donator



Posts : 156
Join date : 2013-05-29
Age : 31

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyFri 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...
Back to top Go down
fr3nchfry
Full Moderator + Donator
Full Moderator + Donator



Posts : 156
Join date : 2013-05-29
Age : 31

Code academy Empty
PostSubject: Re: Code academy   Code academy EmptyMon 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?
Back to top Go down
Sponsored content





Code academy Empty
PostSubject: Re: Code academy   Code academy Empty

Back to top Go down
 
Code academy
Back to top 
Page 1 of 1
 Similar topics
-
» Looking for a shoutbox code

Permissions in this forum:You cannot reply to topics in this forum
 :: GENERAL :: Spam-
Jump to: