-proc check-profits {from to} {
- global products
- set np [expr {[llength $products]/2}]
- puts -nonewline stderr "Thinking: \[[string repeat { } 32]\] "
- puts -nonewline stderr "\[[string repeat { } $np]\] "
- puts -nonewline stderr "\rThinking: \["
- flush stderr
- foreach {a s} [list l $from e $to] {
- for {set f 0} {$f < 256} {incr f} {
- elite-market m $s $f
- foreach {t p} $products { destructure [list ${a}($f:$t) .] $m($t) }
- if {($f & 15) == 15} { puts -nonewline stderr "."; flush stderr }
+proc get-prices {ss arr} {
+ global products allreps
+ upvar \#0 $arr a
+ foreach {t p} $products { set l($t) {} }
+ foreach s [if {[string equal $ss ""]} { set allreps } { set ss }] {
+ if {![string equal $s ""]} {
+ for {set i 0} {$i < 256} {incr i} {
+ elite-market m $s $i
+ foreach {t p} $products { lappend l($t) [lindex $m($t) 0] }
+ }