sábado, 22 de setembro de 2012
unidade Unit1 ;
interface
usa
Janelas , Mensagens , SysUtils , Variants , Classes , gráficos , controles , formulários ,
Diálogos , XPMan , StdCtrls , PCL , matemática ;
tipo
TForm1 = class ( TForm )
Label5 : TLabel ;
Label6 : TLabel ;
GroupBox1 : TGroupBox ;
Label1 : TLabel ;
Label2 : TLabel ;
Edit1 : TEdit ;
Edit2 : TEdit ;
Button1 : TButton ;
GroupBox2 : TGroupBox ;
Label3 : TLabel ;
Edit3 : TEdit ;
Label4 : TLabel ;
Button2 : TButton ;
procedimento FormCreate ( Sender : TObject ) ;
procedimento Button1Click ( Sender : TObject ) ;
procedimento onConnect ;
procedimento onPacket ( pacote : TStringList ) ;
procedimento onError ( eid , pacote : corda ) ;
procedimento button2Click ( Sender : TObject ) ;
procedimento Edit3KeyPress ( Sender : TObject ; var chave : Char ) ;
procedimento Edit2KeyPress ( Sender : TObject ; var chave : Char ) ;
final ;
var Form1 : TForm1 ; Pickle : TPCL ; montante : inteiro ;
implementação {$ R * dfm.}
procedimento TForm1 . FormCreate ( Sender : TObject ) ;
começar
Salmoura : = TPCL . Criar ;
Pickle . cb_connect : = onConnect ;
Pickle . cb_error : = onError ;
Pickle . cb_onpacket : = onPacket ;
final ;
procedimento TForm1 . Button1Click ( Sender : TObject ) ;
começar
edit1 . Ativado : = false ;
edit2 . Ativado : = false ;
button1 . Ativado : = false ;
Pickle . conectar ( edit1 . Texto , edit2 . Texto , '204 .75.167.69:6112 ' , '3693 ' ) ; / / Sundae (PT)
final ;
procedimento TForm1 . onConnect ;
começar
Pickle . sendPacket ( '%% xt% s tic # gptc% -1% " ) ;
final ;
procedimento TForm1 . onPacket ( pacote : TStringList ) ;
começar
se ( embalar [ 1 ] = 'gptc' ) ou ( embalar [ 1 ] = 'iptc' ) ou ( embalar [ 1 ] = 'dptc' ) então
começar
GroupBox1 . Visível : = false ;
GroupBox2 . Visível : = verdadeiro ;
Edit3 . Ativado : = verdadeiro ;
button2 . Ativado : = verdadeiro ;
valor : = strtoint ( pacote [ 3 ] ) ;
label3 . Legenda : = StringReplace ( 'Você tem # # # num # bilhetes.' , '# # # num #' , pacote [ 3 ] , [ ] ) ;
final ;
final ;
procedimento TForm1 . onError ( eid , pacote : corda ) ;
começar
showmessage ( 'Erro' + eid + '(' + pacote + ')' ) ;
aplicação . Finaliza ;
final ;
procedimento TForm1 . button2Click ( Sender : TObject ) ;
var prefixo , bilhetes : corda ; digitado : inteiros ;
começar
digitado : = strtoint ( Edit3 . Texto ) ;
se digitado = quantidade , em seguida sair ;
Edit3 . Ativado : = false ;
button2 . Ativado : = false ;
prefixo : = 'i' ; se quantidade
sexta-feira, 21 de setembro de 2012
quinta-feira, 20 de setembro de 2012
Assinar:
Postagens (Atom)
Chat!
Horário Oficial do Club Penguin