Need some help with AutoRewards Plugin PY

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,074
4,747
113
At your house.
github.com
@DreTaX I'm trying to announce random messages in chat with the same code

Python:
__title__ = 'AutoAnnouncer'
__author__ = 'ice cold'
__version__ = '1.0'

import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite
import sys

path = Util.GetRootFolder()
sys.path.append(path + "\\Save\\Lib\\")
try:
    import random
except ImportError:
    raise ImportError("Failed to import random! Download the lib!")



rose = "[color #ff4040]"

class AutoAnnouncer:
    Timer = None
    Messages = None

    def On_PluginInit(self):
        ini = self.Settings()
        enum = ini.EnumSection("Messages")
        self.Messages = {}
        self.Timer = int(ini.GetSetting("Settings", "Timer"))
        Plugin.CreateTimer("AutoChat", self.Timer).Start()
        for x in enum:
            self.Messages[x] = int(ini.GetSetting("Messages", x))

    def Settings(self):
        if not Plugin.IniExists("Settings"):
            ini = Plugin.CreateIni("Settings")
            ini.AddSetting("Settings", "Timer", "2600000")
            ini.AddSetting("Messages", "1", "Welcome to uberrust")
            ini.AddSetting("Messages", "2", "[color orange]This plugin worked")
            ini.Save()
        return Plugin.GetIni("Settings")


    def AutoChatCallback(self, timer):
        timer.Kill()
        msg = random.choice(self.Messages.keys())
        Server.Broadcast("Messages", x, self.Messages[msg])
        Plugin.CreateTimer("AutoChat", self.Timer).Start()
_
i tried to fix it but it just doesnt work
Server.Broadcast("Messages", x,self.Messages[msg])

wtf

Server.Broadcast("Messages", self.Messages[msg])