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 search
m
m
 
Line 1: Line 1:
 +
//  timestamp {mousex}, {mousey}
 +
//  stop
 +
  
//  timestamp {mousex}, {mousey}
 
//  stop
 
  
 
  constants
 
  constants
Line 9: Line 10:
 
    
 
    
 
   barstart = 17
 
   barstart = 17
  barend = 177
 
 
   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 = 120
+
   //a2ccy = 207
   a6ccy = 224
+
   //a6ccy = 224
   heatbary = 345
+
   //heatbary = 345
   Sp1 = 100
+
   //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 glass
+
   // job = 192  // sheet
   // job = 206 // wine
+
   // job = 206 // wine
 
    
 
    
 
   // bencht = 2  //soda
 
   // bencht = 2  //soda
  //   a2ccy = 120
+
   a2ccy = 120
   //  a6ccy = 150
+
   a6ccy = 150
   //  heatbary = 300
+
   heatbary = 300
 
   // job =  127 // blade
 
   // job =  127 // blade
   //  job =  144 // pipe
+
   job =  144 // pipe
 
   // job =  159 // rod
 
   // job =  159 // rod
   //sp1 = 92 // glass allowed low point
+
   sp1 = 92 // glass allowed low point
   //sp2 = 124 // glass allowed high point
+
   sp2 = 124 // glass allowed high point
   //sp3 = 120 // cc allowed high point
+
   sp3 = 120 // cc allowed high point
  //sp4 = 110 // cc allowed low point(main control point)
+
  sp4 = 110 // cc allowed low point(main control point)
 
    
 
    
 
   // bencht = 3  //fine
 
   // bencht = 3  //fine
Line 46: Line 46:
 
  end // constants
 
  end // constants
 
  Constructs
 
  Constructs
   offset1 = List
+
   List1=List
   oldend2 = List
+
   List2=List
 
  end
 
  end
  
 
  while $done = 0
 
  while $done = 0
 
   delay 1000
 
   delay 1000
   loop $benchs
+
   call getend
   
+
  timestamp  $found, $X
    call getend
+
  if $X < $sp1 //1600
    timestamp  $found, $X
+
    timestamp too cold
    if $X < $Sp1//1600
+
    continue //do nothing
     
+
  end
      continue //too cold do nothing
+
  if $X > $sp2 //2400
    end
+
    timestamp too hot
    if $X > $Sp2 //2400
+
    continue // do nothing
     
+
  end
      continue //too hot do nothing
+
  if $spike = 0
    end
+
    //mousepos $mousx, 50
    if $spike = 0
+
    //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
    else
 
      timestamp spiking
 
      //mainly if meltglass active
 
      continue
 
    end
 
    //stop
 
    if $oldend = $x
 
      continue
 
 
     end
 
     end
     if $oldend < $x // its rising, do nothing
+
  else
      compute oldend = $x
+
    timestamp spiking
      timestamp rising... $oldend < $x
+
    continue
      continue
+
  end
    end
+
  //stop
    // it fell so a tic happened
+
  if $oldend = $x
    if $found = 1
+
     continue
      compute oldend = $x
+
  end
      bell
+
  if $oldend < $x // its rising, do nothing
      call addcc
+
    timestamp rising... $oldend < $x
    else // cold bench
+
    compute oldend = $x
      timestamp not found
+
    continue
    end
+
  end
   end //bench loop
+
  // it fell so a tic happened
 +
  if $found = 1
 +
    compute oldend = $x
 +
    bell
 +
    call addcc
 +
  else // cold bench
 +
    timestamp not found
 +
   end
 
  end //while
 
  end //while
  stop // end main
+
  stop// end main
  
 
  procedure getend
 
  procedure getend
Line 102: Line 106:
 
     //timestamp  {rgbred} {rgbgreen} {rgbblue}
 
     //timestamp  {rgbred} {rgbgreen} {rgbblue}
 
     mousepos $X, $heatbary
 
     mousepos $X, $heatbary
     if $X > $barend
+
     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 // need to look up
+
         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
Line 132: Line 136:
 
     if $X <  $sp4  //2000
 
     if $X <  $sp4  //2000
 
       // add = 6
 
       // add = 6
       isblack $mousx, 123
+
       isblack 14, 123
 
         // click for no glass
 
         // click for no glass
         mousepos 28, 237
+
         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, 223
+
         mousepos $mousx, 180
 
         rightclick
 
         rightclick
 
         timestamp add2 w/o glass $x
 
         timestamp add2 w/o glass $x

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