Note: This forum is merely an archive. It is no longer possible to register or post. - StackOverflow
New Ace of Spades Forums: http://buildandshoot.com/

Scripting help

For all your hosting needs.

Scripting help

Postby HoboHob » Wed Aug 01, 2012 12:37 am

Hello!

I am trying to create a script that is very funny and troll-ish.

But I keep getting a syntax error. First the error, then the code:
Pyspades wrote:Traceback (most recent call last):
File "run.py", line 1004, in <module>
File "C:\Documents and Settings\Computer user\My Documents\Downloads\Random\dist\Scripts\troll.py
, line 13
if self != killer

SyntaxError: invalid syntax


My code:
Code: Select all
#Troll players when they die xD
#By HoboHob (my first script xD)

import random

QUOTES = ["Your suckage level is OVER 9000", "PWNED NUB!", "I don't hack, you just suck", "lol xD"]
QUOTES_SUICIDE = ["You killed yourself xD noob", "I can't stop loling at your fail"]

def apply_script(protocol,connection,config):
   quote = random.random()*3
   class TrollConnection(connection):
      def on_kill(self,killer,type):
         if self != killer
            quote = round(random.random()*3)
            self.send_chat(QUOTES[quote] + " -" + killer)
         else:
            quote = round(random.random())
            self.send_chat(QUOTE_SUICIDE[quote])
         return return connection.on_kill(self, killer, type)
   return TrollConnection
Image
User avatar
HoboHob
Member
 
Posts: 834
Joined: Sat Mar 10, 2012 1:32 am

Re: Scripting help

Postby colorpinpoint » Wed Aug 01, 2012 1:14 am

Go to #pyspades and ask.
Image
Image
IGN:Colorpinpoint
Ki11aWi11 Server Thread
First Map:Here
User avatar
colorpinpoint
Member
 
Posts: 451
Joined: Thu Apr 05, 2012 11:22 pm

Re: Scripting help

Postby HoboHob » Wed Aug 01, 2012 1:52 am

Easier to just post here.
Image
User avatar
HoboHob
Member
 
Posts: 834
Joined: Sat Mar 10, 2012 1:32 am

Re: Scripting help

Postby yako » Thu Aug 02, 2012 7:42 am

Consulting administrator.
Image
yako
Member
 
Posts: 22
Joined: Fri May 04, 2012 10:48 am


Return to Server



Who is online

Users browsing this forum: No registered users and 3 guests

cron