Graal Pastebin

New Paste
Pasted on April 25, 2012.
View the raw file

// Scripted by *callimuc
// Edited by David K?
//#CLIENTSIDE
const layout_image = "callimuc_say3background.png";
const layout_alpha = 0.8;
const TEXT_A   = "A - Close";
const TEXT_N   = "Right Arrow to go to the next page.";
const TEXT_S   = "Left and Right arrow to change scroll speed.";
 
function onCreated() {
  say3_mainwindow.destroy();
  say3(message);
  hideimgs(203, 204);
  this.textStop = 0;
  this.read     = 0;
}
 
 
function say3(end,text_speed,gani,message) {
  //player.chat = end SPC text_speed SPC message;
  this.textStop = 1;
  this.ts  = text_speed;
  endpage  = false;
  skippage = false;
  new GuiBitmapCtrl("say3_mainwindow") {
    extent  = {getimgwidth(layout_image), getimgheight(layout_image)};
    position = {(GraalControl.extent[0]  - extent[0])  / 2, (GraalControl.extent[1] - extent[1]) / 4};
    bitmap = layout_image;
    mode = 1;
    alpha = layout_alpha;
    active = visible = false;
    new GuiScrollCtrl("say3_scroll") {
      useownprofile = true;
      profile.opaque = true;
      profile.border = 0;
      profile.fillcolor = {
          0,  0,  0,  0
      };
      position = {10, 10};
      extent = {say3_mainwindow.extent[0] - (position[0] * 2), say3_mainwindow.extent[1] - (position[1] * 2)-5};
      hScrollBar = "alwaysOff";
      vScrollBar = "alwaysOff";
 
      new GuiMLTextCtrl("say3_text") {
        useownprofile = true;
        profile.fontcolor = {
          61,23,0,225
        };
        position = {0, 0};
        extent   = {say3_scroll.extent[0], say3_scroll.extent[1]};
        text     = " ";
      }
    }
  }
  if (message != NULL) {
    setani(gani, NULL);
    this.reading = true;
    disabledefmovement();
    say3_mainwindow.show();
    this.end = false;
 
    with (findimg(203)) {
      layer = 4;
      text  = TEXT_S;
      style = "bl";
      zoom  = 0.75;
      alpha = 0.8;
      mode  = 1;
      x = say3_mainwindow.position[0] + 20;
      y = say3_mainwindow.position[1] + say3_mainwindow.extent[1] + 3;
      textshadow = true;
      shadowoffset = {1, 1};
      shadowcolor = {0, 0, 255, 255};
    }
 
    for (this.newText = 0; this.newText < message.length(); this.newText ++) { 
      say3_text.text = "<font size = 20><b>" @ message.substring(0, this.newText) @ "</b></font>";
      say3_scroll.scrollToBottom();
      if (message.substring(this.newText, 1) == '.'){
        sleep(this.ts + .15);
      }
      else{
        sleep(this.ts);
      }
      if (skippage){
        break;
      }
    }
 
    say3_text.text = "<font size = 20><b>" @ message @ "</b></font>";
    say3_scroll.scrollToBottom();
    sleep(.5);
    this.end = true;
    if (end){
      hideimg(203);
      endpage = 1;
      with (findimg(204)) {
        layer = 4;
        text = TEXT_A;
        style = "br";
        zoom = 0.75;
        alpha = 0.8;
        mode = 1;
        x = say3_mainwindow.position[0] + say3_mainwindow.extent[0];
        y = say3_mainwindow.position[1] + say3_mainwindow.extent[1] + 3;
        textshadow   = true;
        shadowoffset = {1, 1};
        shadowcolor  = {0, 0, 255, 255};
      }
    }
    else {
      with (findimg(203)) {
        layer = 4;
        text  = TEXT_N;
        style = "bl";
        zoom  = 0.75;
        alpha = 0.8;
        mode  = 1;
        x = say3_mainwindow.position[0] + 20;
        y = say3_mainwindow.position[1] + say3_mainwindow.extent[1] + 3;
        textshadow = true;
        shadowoffset = {1, 1};
        shadowcolor = {0, 0, 255, 255};
      }
    }
 
  }
}
 
function onDestroySay3() {
  this.textStop = 0;
  say3_mainwindow.hide();
  hideimgs(203, 204);
  this.reading = false;
}
 
 
 
function onKeyPressed(key) {
  if (key == 37 && this.ts >= .01 && this.reading){
    if (this.ts => .3){
      this.ts = .3;
    }
    else {
      this.ts += .02;
    } 
  }
  if (key == 39 && this.ts <= .3 && this.reading){
    if (this.ts <= .02){
      this.ts = .01;
    }
    else {
      this.ts -= .02;
    } 
  } 
  if (key == 39 && this.end && endpage != true){
    endpage = true;
    this.textStop = 0;
    this.read++;
    onDestroySay3();
  } 
  if (key == 38 && this.end != true){
    this.page--;
  }
  if (key == 40 && this.end != true && this.ts > .02){
    skippage = true;
  }    
  if (key == 65 && this.reading == true){
    this.read++;
    enabledefmovement();
    onDestroySay3();
  }  
}
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174