The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.
If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.
Difference between revisions of "User:Strutter/glass"
From A Tale in the Desert
Jump to navigationJump to searchm |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | // timestamp {mousex}, {mousey} | ||
+ | // stop | ||
− | |||
− | |||
− | constants | + | |
+ | constants | ||
X = 17 | X = 17 | ||
y = 1 | y = 1 | ||
Line 9: | Line 10: | ||
barstart = 17 | barstart = 17 | ||
− | |||
oldend = null | oldend = null | ||
found = 0 //loop flags | found = 0 //loop flags | ||
Line 16: | Line 16: | ||
benchs = 1 | benchs = 1 | ||
//bencht = 1 //normal | //bencht = 1 //normal | ||
− | a2ccy = | + | //a2ccy = 207 |
− | a6ccy = 224 | + | //a6ccy = 224 |
− | heatbary = 345 | + | //heatbary = 345 |
− | + | //sp1 = 100 // glass allowed low point | |
− | sp2 = 142 | + | //sp2 = 142 // glass allowed high point |
− | sp3 = 141 | + | //sp3 = 141 // cc allowed high point |
− | sp4 = 124 | + | //sp4 = 124 // cc allowed low point(main contoll point) |
− | // job = 127 // torch | + | // job = 127 // torch |
− | // job = 144 // jar | + | // job = 144 // jar |
− | // job = 159 // pipe | + | // job = 159 // pipe |
− | // job = 177 // rod | + | // job = 177 // rod |
− | job = 192 // sheet | + | // job = 192 // sheet |
− | // job = 206 // wine | + | // job = 206 // wine |
// bencht = 2 //soda | // bencht = 2 //soda | ||
− | + | a2ccy = 120 | |
− | + | a6ccy = 150 | |
− | + | heatbary = 300 | |
// job = 127 // blade | // job = 127 // blade | ||
− | + | job = 144 // pipe | |
// job = 159 // rod | // job = 159 // rod | ||
− | + | sp1 = 92 // glass allowed low point | |
− | + | sp2 = 124 // glass allowed high point | |
− | + | sp3 = 120 // cc allowed high point | |
− | + | sp4 = 110 // cc allowed low point(main control point) | |
// bencht = 3 //fine | // bencht = 3 //fine | ||
− | end // constants | + | end // constants |
− | Constructs | + | Constructs |
− | + | List1=List | |
− | + | List2=List | |
− | end | + | end |
− | while $done = 0 | + | while $done = 0 |
delay 1000 | delay 1000 | ||
− | + | call getend | |
− | + | timestamp $found, $X | |
− | + | if $X < $sp1 //1600 | |
− | + | timestamp too cold | |
− | + | continue //do nothing | |
− | + | end | |
− | + | if $X > $sp2 //2400 | |
− | + | timestamp too hot | |
− | + | continue // do nothing | |
− | + | end | |
− | + | if $spike = 0 | |
− | + | //mousepos $mousx, 50 | |
− | + | //rightclick | |
+ | //delay 100 | ||
+ | isblack 120, 381 //values may vary with $job | ||
+ | else | ||
+ | mousepos 50,50 | ||
+ | rightclick // update window | ||
isblack 14, 123 | isblack 14, 123 | ||
timestamp loading glass | timestamp loading glass | ||
− | mousepos $mousx, $job | + | mousepos $mousx, $job |
rightclick | rightclick | ||
end | end | ||
− | |||
− | |||
− | |||
− | |||
end | end | ||
− | //stop | + | else |
− | + | timestamp spiking | |
− | + | continue | |
− | + | end | |
− | + | //stop | |
− | + | if $oldend = $x | |
− | + | continue | |
− | + | end | |
− | + | if $oldend < $x // its rising, do nothing | |
− | + | timestamp rising... $oldend < $x | |
− | + | compute oldend = $x | |
− | + | continue | |
− | + | end | |
− | + | // it fell so a tic happened | |
− | + | if $found = 1 | |
− | + | compute oldend = $x | |
− | + | bell | |
− | end | + | call addcc |
− | end //while | + | else // cold bench |
− | stop // end main | + | timestamp not found |
+ | end | ||
+ | end //while | ||
+ | stop// end main | ||
− | procedure getend | + | procedure getend |
compute found = 0 // default to not found | compute found = 0 // default to not found | ||
while $found = 0 | while $found = 0 | ||
Line 102: | Line 106: | ||
//timestamp {rgbred} {rgbgreen} {rgbblue} | //timestamp {rgbred} {rgbgreen} {rgbblue} | ||
mousepos $X, $heatbary | mousepos $X, $heatbary | ||
− | if $X > | + | if $X > 270 |
compute found = 1 | compute found = 1 | ||
end | end | ||
Line 111: | Line 115: | ||
compute found = 1 // found temperature of bench | compute found = 1 // found temperature of bench | ||
else | else | ||
− | inc $x | + | inc $x // need to look up |
end | end | ||
else | else | ||
Line 121: | Line 125: | ||
dec $x // not at start, not red, so look down | dec $x // not at start, not red, so look down | ||
end | end | ||
− | end | + | end |
end // while | end // while | ||
− | end // procedure | + | end // procedure |
− | procedure addcc | + | procedure addcc |
mousepos 50,50 | mousepos 50,50 | ||
rightclick // update window | rightclick // update window | ||
Line 132: | Line 136: | ||
if $X < $sp4 //2000 | if $X < $sp4 //2000 | ||
// add = 6 | // add = 6 | ||
− | isblack | + | isblack 14, 123 |
// click for no glass | // click for no glass | ||
− | mousepos | + | mousepos $mousx, 190 |
rightclick | rightclick | ||
timestamp add6 w/o glass $x | timestamp add6 w/o glass $x | ||
Line 147: | Line 151: | ||
isblack 14, 123 | isblack 14, 123 | ||
// click for no glass | // click for no glass | ||
− | mousepos $mousx, | + | mousepos $mousx, 180 |
rightclick | rightclick | ||
timestamp add2 w/o glass $x | timestamp add2 w/o glass $x | ||
Line 158: | Line 162: | ||
end | end | ||
end | end | ||
− | end // procedure | + | end // procedure |
Latest revision as of 03:04, 24 June 2009
// timestamp {mousex}, {mousey} // stop
constants X = 17 y = 1 mousx = 17 barstart = 17 oldend = null found = 0 //loop flags done = 0 spike = 1 benchs = 1 //bencht = 1 //normal //a2ccy = 207 //a6ccy = 224 //heatbary = 345 //sp1 = 100 // glass allowed low point //sp2 = 142 // glass allowed high point //sp3 = 141 // cc allowed high point //sp4 = 124 // cc allowed low point(main contoll point) // job = 127 // torch // job = 144 // jar // job = 159 // pipe // job = 177 // rod // job = 192 // sheet // job = 206 // wine // bencht = 2 //soda a2ccy = 120 a6ccy = 150 heatbary = 300 // job = 127 // blade job = 144 // pipe // job = 159 // rod sp1 = 92 // glass allowed low point sp2 = 124 // glass allowed high point sp3 = 120 // cc allowed high point sp4 = 110 // cc allowed low point(main control point) // bencht = 3 //fine end // constants Constructs List1=List List2=List end
while $done = 0 delay 1000 call getend timestamp $found, $X if $X < $sp1 //1600 timestamp too cold continue //do nothing end if $X > $sp2 //2400 timestamp too hot continue // do nothing end if $spike = 0 //mousepos $mousx, 50 //rightclick //delay 100 isblack 120, 381 //values may vary with $job else mousepos 50,50 rightclick // update window isblack 14, 123 timestamp loading glass mousepos $mousx, $job rightclick end end else timestamp spiking continue end //stop if $oldend = $x continue end if $oldend < $x // its rising, do nothing timestamp rising... $oldend < $x compute oldend = $x continue end // it fell so a tic happened if $found = 1 compute oldend = $x bell call addcc else // cold bench timestamp not found end end //while stop// end main
procedure getend compute found = 0 // default to not found while $found = 0 LoadRGB $X, $heatbary //timestamp {rgbred} {rgbgreen} {rgbblue} mousepos $X, $heatbary if $X > 270 compute found = 1 end if {rgbred} < 135 // if bar is red at x,y compute $y = $x + 1 LoadRGB $y, $heatbary if {rgbred} > 150 // and the bar is not red at x+1,y compute found = 1 // found temperature of bench else inc $x // need to look up end else if $x = $barstart compute found = -1 // bench is cold else compute $spike = 0 timestamp spike alert over dec $x // not at start, not red, so look down end end end // while end // procedure
procedure addcc mousepos 50,50 rightclick // update window timestamp add temp range if $X < $sp3 //2300 if $X < $sp4 //2000 // add = 6 isblack 14, 123 // click for no glass mousepos $mousx, 190 rightclick timestamp add6 w/o glass $x else // click for glass mousepos $mousx, $a6ccy rightclick timestamp add6 w/ glass $x end else //add = 2 isblack 14, 123 // click for no glass mousepos $mousx, 180 rightclick timestamp add2 w/o glass $x else // click for glass mousepos $mousx, $a2ccy rightclick timestamp add2 w/ glass $x end end end end // procedure