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.

User:Strutter/glass

From A Tale in the Desert
Jump to navigationJump to search
//  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