SHARE
TWEET

Untitled

a guest Jul 12th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. import processing.net.*;
  4.  
  5. String PersonalKey="POIGRAY";
  6.  
  7. int myname=0;
  8. Client myClient;
  9. String dataIn;
  10.  
  11. int stavka=0;
  12. String pos="";
  13.  
  14. void setup(){
  15.   size(600,600);
  16.   myClient = new Client(this, "192.168.88.103", 7777);
  17. }
  18.  
  19. void draw(){
  20.   background(0);
  21.   fill(240);
  22.   textSize(16);
  23.   text("~ 1 2 3 4 5 6 7 8 9  0  -  +",20,450);
  24.   fill(200);
  25.   text("0 1 2 3 4 5 6 7 8 9 10 11 12",20,470);
  26.   fill(240);
  27.   text("     Q         W        E         R",320,450);
  28.   fill(200);
  29.   text("+1000  +100   +10      +1",320,470);
  30.   fill(200);
  31.   text(" -1000  -100    -10       -1",320,490);  
  32.   fill(240);
  33.   text("     A         S        D         F",320,510);
  34.  
  35.   fill(240);
  36.   text("press ENTER to send",20,560);
  37.  
  38.    fill(200);
  39.   text("RED   BLUE    ODD   EVEN",20,490);
  40.    fill(240);
  41.   text("  Z        X         C        V",20,510);
  42.  
  43.   textSize(60);
  44.   fill(250);
  45.   text("Position:  "+pos, 10,250);
  46.   text("Value:     "+stavka, 10,320);
  47.  
  48.  
  49. }
  50.  
  51. void keyPressed() {
  52.   int code =keyCode;
  53.   println(code);
  54.   switch (code){
  55.   case 192:pos=" 0"; break;
  56.   case 49:pos=" 1";break;
  57.   case 50:pos=" 2";break;
  58.   case 51:pos=" 3";break;
  59.   case 52:pos=" 4";break;
  60.   case 53:pos=" 5";break;
  61.   case 54:pos=" 6";break;
  62.   case 55:pos=" 7";break;
  63.   case 56:pos=" 8";break;
  64.   case 57:pos=" 9";break;
  65.   case 48:pos="10";break;
  66.   case 45:pos="11";break;
  67.   case 61:pos="12";break;
  68.  
  69.  
  70.   case 81:stavka+=1000;break;
  71.   case 87:stavka+=100;break;
  72.   case 69:stavka+=10;break;
  73.   case 82:stavka+=1;break;
  74.  
  75.   case 65:stavka-=1000;break;
  76.   case 83:stavka-=100;break;
  77.   case 68:stavka-=10;break;
  78.   case 70:stavka-=1;break;
  79.  
  80.  
  81.  
  82.   case 90: pos="red";break;
  83.   case 88: pos="blue";break;
  84.   case 67: pos="odd";break;
  85.   case 86: pos="even";break;
  86.  
  87.  
  88.   case 10: if(stavka>0&&!pos.equals("")) ; send(pos,stavka);break;
  89.  
  90.  
  91.   }
  92.   if (stavka<0) stavka=0;
  93. }
  94.  
  95. void send(String pos, int stavka){
  96.  if (stavka>0) {
  97.    myClient.write(PersonalKey+":"+pos+":"+stavka+";");
  98.  }
  99. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top