scripts wanted

2005-07-09
2013-04-30
  • Jim Showalter
    Jim Showalter
    2005-07-09

    Anyone have a Jin script they would like to share with the rest of us?  I'm trying to learn and would like to see whatever you have.

    Here are  three of my command scripts that work on both ICC and FICS:

    salute - tell your opponent whatever at game completion.

    Script Name: -> salute
    Event Type: -> Game
    Event Subtypes: -> Game End
    Condition: -> !(gameResult.equals("unknown"))
    Commands: -> say Thanks for the game!

    On FICS I have an alias 'thanks' = "say Thanks for the game, $o!"  The '$o' is replaced by your opponents name.  Then I just trigger the alias from the script with:

    Commands: -> thanks

    bailout: sends apology to your opponent if you have to abort.

    Script Name: -> bailout
    Event Type: -> Text (Unparsed text)
    Event Subtypes: -> none

    ICC
    Condition: -> text.equals("Game aborted.")
    Commands: -> say Sorry, but I must abort.

    FICS: (alias 'bail' = "say Sorry $o, but I must abort.")
              (see my alias explanation in 'salute').
    Condition: -> text.equals("The game has been aborted on move one.")
    Commands: -> bail
    ============================================

    mget: posts up to 3 seeks at a time.
    (I don't use this on ICC because they allow aliases like:
    "+alias mget ; seek 4 15 ; seek 5 12 ; seek 6 10")

    Script Name: -> mget
    Event Type: -> User Invoked
    Event Subtypes: -> none
    Condition: -> true
    Commands: -> seek 4 15
                            seek 5 12
                            seek 6 10
    ============================================

     
    • whp
      whp
      2005-08-05

      Here something you could bite.
      Type: Connection
      Subtype: login

      import java.util.Date;

      String filename = "a path to some file";
      FileOutputStream fout = new FileOutputStream(filename, true);
      PrintStream out = new PrintStream(fout);
      out.println(new Date());
      out.close();

      This is a bash script. It just prints a date of login to fics to a file. In my example this file serves also to log some channel tells (you can find script doing that on the jin home site).

       
    • whp
      whp
      2005-08-05

      And the second one is also a BeanShell script (sorry for a mistake in the last post of mine).

      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;

          Object[] woptions = {"Congrat Opp", "Rematch", "Close"};

          int    act = JOptionPane.showOptionDialog(null,
                  "Game ends.",
                  "After match manager",
                  JOptionPane.YES_NO_CANCEL_OPTION,
                  JOptionPane.INFORMATION_MESSAGE,
                  null,
                  woptions,
                  woptions[2]);
                  if (act == JOptionPane.YES_OPTION) {
                              sendCommand( "tell " + oppName + " Thanks for playing " + oppName);
                                                      appendLine("Congratlations sent to " + oppName);
                          }
                  else if (act == JOptionPane.NO_OPTION) {
                              sendCommand( "rematch" );
                                                      appendLine("rematch command issued");
                          }
                  else if (act == JOptionPane.CANCEL_OPTION){
                          }
                  else {
                            }
      Type: Game
      Subtype: GameEnd

      I won't say what it does - try it yourself:). Play a game.