So... we see you haven't signed up here on our website.  

Do you really want to sit here and be "Unregistered" all your life?  No, of course you don't!  So, click this here link and you'll take that all important first step into enlightenment! (or something, whatever...)

[DOC] Event Variables

Discussion in 'General' started by Trekkan, Dec 12, 2016.

  1. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,225
    Each event has a set of variables associated with them. Generally speaking, each event would have a set of player variables, etc. An event like the AirDrop, of course wouldn't. Below is a list of all of the current variables available to you. Eventually this list will be cleaned up and displayed per event, etc. But for now, this is what ya get. =)

    Common
    {servername}
    {ratversion}
    {datetime}
    {date}
    {time}
    {airdropcoords}
    {airdrop_coords}
    {player_online_count}

    {0} - All arguments passed in on a command
    {n} - Argument number of the passed in arguments to the command, space delimited

    Player Data
    {player_id}
    {player_name} (Use {{player_name}} to wrap the player name in double quotes)
    {player_country}
    {player_pos}
    {player_rot}
    {player_remote}
    {player_health}
    {player_deaths}
    {player_zombies}
    {player_playerkills}
    {player_score}
    {player_level}
    {player_steamid}
    {player_ip}
    {player_ping}
    {player_status}
    {player_lastseen}
    {player_chat}

    Kick Event
    {kicker_name}
    {kicker_reason}

    Ban Event
    {ban_by_name}
    {ban_name}
    {ban_duration}
    {ban_timespan}
    {ban_reason}

    Seen Event
    {seen_name}
    {seen_time}

    Teleport Event

    {tele_dest_name}
    {tele_dest_loc}
    {tele_dest_max}
    {tele_dest_time}

    Game Time

    {gametime_full}
    {gametime_day}
    {gametime_hour}
    {gametime_minute}

    Other

    {airdrop_coords}
    {bloodmoon_days}
    {random_number}
     
    Last edited: Sep 9, 2017
    • Like Like x 1
  2. Ian Lee

    Ian Lee New Member

    Points:
    37
    I created an event using {bloodmoon_days} and it does not appear to work. The event I created is as below:

    Bloodmoon is {bloodmoon_days} days away.
    However, the value for {bloodmoon_days} always appears blank when the message appears.

    Ex.
    Server: Bloodmoon is days away.

    Am I doing something wrong?

    Thanks!
    Ian
     
  3. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,225
    Try using this as the script: .BLOODMOON:PUBLIC:The next bloodmoon is in {bloodmoon_next} days!||The next bloodmoon is tonight!

    I changed the signature of that function a while back and it might be that you still have the old one. Sorry about that!
     
  4. Ian Lee

    Ian Lee New Member

    Points:
    37
    I tried that and all I got chatted was the literal copy of that instead of the expected translated text. I'm using v0.1.12.8 which it says is the latest. Is there something I need to turn on to make the scripts work?

    On a similar note, I'd like to request a button in the messages panel to allow sending a message on demand instead of waiting for the timer. That would make testing easier and might have other uses.

    Thanks!
    Ian
     
  5. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,225
    There are technically three versions of RAT available at the moment. Resources | Just For Fun Gaming Community

    I'd recommend the experimental version as it has a lot of fixes in it, ones that probably fix the issues you're having.

    As for the suggestion, I'll try and remember it, but please post it in the feature request forum as well. =)
     
  6. Ian Lee

    Ian Lee New Member

    Points:
    37
    I've installed the experimental version and I got the same behavior. However, I've fixed the issue. It seems that {bloodmoon_days} is no longer valid but the {bloodmoon_next} that you showed does work. I couldn't get the script to work at all. It just output the script to the chat. This is what I entered as the message:

    .BLOODMOON:PUBLIC:The next bloodmoon is in {bloodmoon_next} days!||The next bloodmoon is tonight!
    On a similar note... Is there a way to do math in message? For example, I'd like to create a message that announces when the trader has restocked. I suppose a {traderrestock_next} would accomplish this if there was such a thing but perhaps a more flexible option would be to be able to do something like:

    Trader's will restock in [{bloodmoon_next} + 1] days!​

    If this is already possible let me know. Otherwise, I'll add it to the feature requests.

    Thanks!
    Ian
     
  7. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,225
    I'll have to look into the bloodmoon script closer, it should work (and does work for some, so not sure what the problem here is). Assuming you still have the problem? Not 100% sure its fixed or not. =)

    As to the math, there currently isn't a way to do MATH in the script, so a feature request would be good.
     

Share This Page