View unanswered posts | View active topics It is currently Thu Apr 23, 2026 12:02 am



Reply to topic  [ 2 posts ] 
 Random Corp Generation 
Author Message
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post 
The script is meant to be ran from within the game and currently echos to the user's local screen. This can be changed to echo to fed com if desired by removing the # as noted. Anyone that wants to make changes/improvements to this script, please feel free to do so. Two test outputs will follow the code.

Code:
# Random corp assignments

send "clvq"
waitfor "--- ---------------------"
setVar $i 0

:loopTrader
  setTextLineTrigger getTrader :getTrader "   "
  setTextTrigger compDone :compDone "Computer command"
  pause

:getTrader
  killtrigger compDone
  add $i 1
  cuttext currentline $trader[$i] 30 30
  goto :loopTrader

:compDone
  killtrigger getTrader
  echo ANSI_11 "*How many players do you want on a corp?"
  getConsoleInput $numPlayers

  if ($numPlayers = 0) or ($numPlayers > $i)
      echo ANSI_12 "* Sorry the number of players entered for a corp is not allowed*"
      echo ANSI_12 "* Press ~ to continue*"
      setTextOutTrigger cont :compDone "~"
      pause
  end

setVar $corps $i
divide $corps $numPlayers

setVar $icnt 1
# ------------------- Remove comment # from next line to output to fed com
#   send "`*"
while ($icnt <= $i)
   getRnd $corpNumber 1 $corps
   :recheck
   if ($corpAssign[$corpNumber] = $numPlayers)
       add $corpNumber 1
       if ($corpNumber > $corps)
              if ($pass = 1)
                 goto oneAssignments
              end
              setvar $corpNumber 1
              setVar $pass 1
       end
       goto :recheck
   end
   setVar $pass 0
   add $corpAssign[$corpNumber] 1
   echo "*" $trader[$icnt] " Assigned to corp:  " $corpNumber
   # to output to fed remove the # from the next line
  # send  $trader[$icnt] " Assigned to corp:  " $corpNumber "*"

   add $icnt 1
end

oneAssignments
# remove comment from next line to close fed com if output to there
# send "*"


(Format is messed up here)

ex 1:
Ppp         &nb sp;         &nb sp;        Assigned to corp: 4
DarkHelmet        &n bsp;         &n bsp;  Assigned to corp: 2
quotes                             Assigned to corp: 4
Fork         &n bsp;         &n bsp;       Assigned to corp: 1
Wolfen                             Assigned to corp: 2
fujidude        &nbs p;         &nbs p;   Assigned to corp: 4
-= Geek Assasin =-         &nbs p;   Assigned to corp: 5
Kane         &n bsp;         &n bsp;       Assigned to corp: 5
Titan         & nbsp;         & nbsp;      Assigned to corp: 5
Red Knight          &nbs p;         &nbs p;  Assigned to corp: 3
legosoldier        & nbsp;         & nbsp; Assigned to corp: 2
wtf         &nb sp;         &nb sp;        Assigned to corp: 1
123         &nb sp;         &nb sp;        Assigned to corp: 3
456         &nb sp;         &nb sp;        Assigned to corp: 1
dupe         &n bsp;         &n bsp;       Assigned to corp: 3

-------------

ex2

Ppp         &nb sp;         &nb sp;        Assigned to corp: 1
DarkHelmet        &n bsp;         &n bsp;  Assigned to corp: 5
quotes                             Assigned to corp: 4
Fork         &n bsp;         &n bsp;       Assigned to corp: 5
Wolfen                             Assigned to corp: 3
fujidude        &nbs p;         &nbs p;   Assigned to corp: 3
-= Geek Assasin =-         &nbs p;   Assigned to corp: 1
Kane         &n bsp;         &n bsp;       Assigned to corp: 2
Titan         & nbsp;         & nbsp;      Assigned to corp: 4
Red Knight          &nbs p;         &nbs p;  Assigned to corp: 2
legosoldier        & nbsp;         & nbsp; Assigned to corp: 5
wtf         &nb sp;         &nb sp;        Assigned to corp: 1
123         &nb sp;         &nb sp;        Assigned to corp: 3
456         &nb sp;         &nb sp;        Assigned to corp: 2
dupe         &n bsp;         &n bsp;       Assigned to corp: 4

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Fri Jan 12, 2007 12:33 am
Profile ICQ
Gunnery Sergeant

Joined: Sun Jan 14, 2007 3:56 am
Posts: 24
Location: United States
Unread post 
LOL never thought I would use this script, but I am. Thanks so much man, nice nice


Sun Feb 11, 2007 3:11 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 36 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.