SQL Script to make your Server Post Messages

Results 1 to 3 of 3
  1. #1
    Ultimate Member Drewww is offline
    MemberRank
    Apr 2015 Join Date
    164Posts

    SQL Script to make your Server Post Messages

    This will be my last SQL script for a while. I think I have posted enough examples how to use basic SQL commands to make things happen. I would like to see other people posting useful information, specially getting siege wars working, or someone explaining how to create new game content.

    So here is the SQL script that will make your server post a message at preset times. You can modify figures to see the end result. First time you run it all message will be displayed at one time, but after that they will display at the correct intervals.
    EndTime should be obvious what it means.
    IntervalTime is the time in minutes when the message will be displayed again.
    NextTime can be an offset in time to the IntervalTime

    My example is each hour messages will being displaying from the first message, and every 4 minutes after it will display the next message.

    Code:
    /****** Interval Time apears to be Minutes
     ****** Also the NextTime can be used to offset the following messages
     ****** if you using the same Interval time  ******/
    
    
    USE ROM_ImportDB
    GO
    TRUNCATE TABLE [dbo].[BroadcastingTable]
    GO
    INSERT INTO [ROM_ImportDB].[dbo].[BroadcastingTable]
    ([WorldID], [StartTime],            [EndTime],              [IntervalTime], [NextTime],             [Message]) VALUES
    (1,         N'2000-01-01 00:00:00', N'2015-12-31 00:00:00', 60,             N'2015-01-01 00:00:00', N'SYSTEM - If you have a game issue then suck it up and fix it yourself.'),
    (1,         N'2000-01-01 00:00:00', N'2015-12-31 00:00:00', 60,             N'2015-01-01 00:04:00', N'SYSTEM - If you need a zone opened please MSG a GM'),
    (1,         N'2000-01-01 00:00:00', N'2015-12-31 00:00:00', 60,             N'2015-01-01 00:08:00', N'SYSTEM - PreDesigned, Statted+Runed Gear is available on request, MSG GM'),
    (1,         N'2000-01-01 00:00:00', N'2015-12-31 00:00:00', 60,             N'2015-01-01 00:12:00', N'SYSTEM - Do you have an Event you would like enabled ?. Well GM can fix that. Let him know what you want.'),
    (1,         N'2000-01-01 00:00:00', N'2015-12-31 00:00:00', 60,             N'2015-01-01 00:16:00', N'SYSTEM - MicroMacro is Allowed for running one toon at one time and for testing.'),
    (1,         N'2000-01-01 00:00:00', N'2015-12-31 00:00:00', 60,             N'2015-01-01 00:20:00', N'SYSTEM - Romio allowed anywhere.'),
    (1,         N'2000-01-01 00:00:00', N'2015-12-31 00:00:00', 60,             N'2015-01-01 00:24:00', N'SYSTEM - Model Folders allowed, TIP: Do not use when questing.'),
    (1,         N'2000-01-01 00:00:00', N'2015-12-31 00:00:00', 60,             N'2015-01-01 00:28:00', N'SYSTEM - It cost money for power bills to keep this server running, please donate to keep it running.'),
    (1,         N'2000-01-01 00:00:00', N'2015-12-31 00:00:00', 60,             N'2015-01-01 00:32:00', N'SYSTEM - Botting dailys and mini games allowed, BUT gold farm botting allowed on ONE TOON AT A TIME ONLY ok.'),
    (1,         N'2000-01-01 00:00:00', N'2015-12-31 00:00:00', 60,             N'2015-01-01 00:36:00', N'SYSTEM - Current Event is --Crafting--');
    GO
    If you can get the hang of this then you can also use similar coding for users doing a cash donation via a webpage and the game sending them diamonds. It isn't hard when you can combine PHP and SQL. I will leave someone else to figure it out for now. I am reluctant to share that info cause I feel it can cause problems with people thinking it is a way to make a quick buck of mates.

    <-- like


  2. #2
    Registered andelwol26 is offline
    MemberRank
    Mar 2017 Join Date
    9Posts

    Re: SQL Script to make your Server Post Messages

    How could i use your Script?

    I tested to modify it and execute it in MS SQL. But it tells me the Synthax is wrong.
    When i paste your original script the same error occurs.

    Could you help me please?

  3. #3
    Member mollo is offline
    MemberRank
    Sep 2014 Join Date
    GermanyLocation
    59Posts

    Re: SQL Script to make your Server Post Messages

    try to paste it without all the N'. often it worked then for me!

    btw, I co-developed some sql scripts you will find of drewww and he used an older version of sql server. often you just can delete these
    N' and then it should work
    Last edited by mollo; 18-09-18 at 01:55 AM.



Advertisement