Skip to content

Commit

Permalink
Remove 'open Robot'
Browse files Browse the repository at this point in the history
  • Loading branch information
fablhx committed Jul 11, 2018
1 parent ff2f6be commit 6924779
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions contrib/gwbase/etc/probot.ml
@@ -1,38 +1,39 @@
(* camlp5r *)
(* $Id: probot.ml,v 1.7 2006-10-05 13:37:58 deraugla Exp $ *)

open Robot;

value main () =
let xcl = input_excl (open_in_bin "cnt/robot") in
let xcl = Robot.input_excl (open_in_bin "cnt/robot") in
let tm_now = Unix.time () in
do {
if xcl.excl <> [] then Printf.printf "excl\n" else ();
List.iter (fun (s, ri) -> Printf.printf " \"%s\" %d\n" s ri.val) xcl.excl;
if xcl.Robot.excl <> [] then Printf.printf "excl\n" else ();
List.iter
(fun (s, ri) -> Printf.printf " \"%s\" %d\n" s ri.val)
xcl.Robot.excl;
Printf.printf "who\n";
let sorted_who =
List.sort
(fun (k1, w1) (k2, w2) ->
compare (List.hd w1.acc_times) (List.hd w2.acc_times))
(W.fold (fun k x l -> [(k, x) :: l]) xcl.who [])
compare (List.hd w1.Robot.acc_times) (List.hd w2.Robot.acc_times))
(Robot.W.fold (fun k x l -> [(k, x) :: l]) xcl.Robot.who [])
in
List.iter
(fun (k, w) ->
let tml = w.acc_times in
let _tm0 = w.oldest_time in
let cnt = w.nb_connect in
let bn = w.nbase in
let nfw = w.utype in
let tml = w.Robot.acc_times in
let _tm0 = w.Robot.oldest_time in
let cnt = w.Robot.nb_connect in
let bn = w.Robot.nbase in
let nfw = w.Robot.utype in
do {
Printf.printf " %s (%d)" k cnt;
match nfw with
[ Wizard n ->
[ Robot.Wizard n ->
Printf.printf " (\027[31mwiz %s%s\027[30m)" bn
(if n = "" then "" else " " ^ n)
| Friend n ->
| Robot.Friend n ->
Printf.printf " (\027[34mfri %s%s\027[30m)" bn
(if n = "" then "" else " " ^ n)
| Normal -> () ];
| Robot.Normal -> () ];
Printf.printf "\n";
Printf.printf " ";
let cnt = ref 0 in
Expand All @@ -50,7 +51,10 @@ value main () =
})
sorted_who;
Printf.printf "max_conn\n";
Printf.printf " %d \"%s\"\n" (fst xcl.max_conn) (snd xcl.max_conn);
Printf.printf
" %d \"%s\"\n"
(fst xcl.Robot.max_conn)
(snd xcl.Robot.max_conn);
flush stdout;
}
;
Expand Down

0 comments on commit 6924779

Please sign in to comment.