Server Help

ASSS Custom Projects - how to make a python module for ASSS

hellzlaker - Sun Mar 02, 2008 3:03 pm
Post subject: how to make a python module for ASSS
how do you make your python code to be in ASSS ?

like i made a simple calculator
Code: Show/Hide
loop = 1
choice = 0
while loop == 1:
    print " Welcome to Simple Calculator"
    print "your options are:"
    print " "
    print " 1) Add"
    print " 2) Subtract"
    print " 3) Exit"

    choice = input("Choose your option: ")

    if choice ==1:
        add1 = input("add: ")
        add2 = input("to: ")
        print "equals = ", add1 + add2
    elif choice == 2:
        sub1 = input ("subtract from: ")
        sub2 = input ("subtract: ")
        print "equals = ", sub1 - sub2
    else:
        loop = 0
print "Thank you for using Simple Calculator."


how do i make this a module for ASSS? do i like add include asss.exe or something?
tcsoccerman - Sun Mar 02, 2008 3:11 pm
Post subject:
the best way for you to learn is too look at other modules made by other people and try to comprehend what it all means.
hellzlaker - Sun Mar 02, 2008 3:19 pm
Post subject:
i ment would the code i wrote work if i added as a module to ASSS?
Dr Brain - Sun Mar 02, 2008 3:31 pm
Post subject:
No. Look at other python modules.
hellzlaker - Sun Mar 02, 2008 4:26 pm
Post subject:
ok i know how they start just a simple question how to make it like if you write ?hey it answers back "hey"

should be a simple code
Smong - Sun Mar 02, 2008 7:35 pm
Post subject:
If you want to try something like that check this guide out Writing Modules In Python - Commands.

Your original code can't be converted to an asss module easily since it relies on a console for input. Once you strip off all that you are left with "add1 + add2" which will work on asss.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group