May 03, 2024, 05:28:32 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


IB to EB Converter

Started by JoaoAfonso, August 15, 2007, 05:46:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JoaoAfonso

Hey! Good morning :)

I am writing because I've downloaded a program who converts IB STD to IB PRO, that should work also in EB. I am sorry for not remember who done it, or from where I got it, but anyway every code I convert from IB STD, it returns always error when running in EB.

As you may know/check, I am from Portugal. Here we write letters like ÃÆ'Ã,§, ÃÆ'Ã,©, ÃÆ'Ã, , ÃÆ'Ã,­, etc, and one of the error messages EB warns is about it.

Is out there a good converter, or a good way to change a 4k line program from IB std to eb? I would like to use just one of those languages (and atm I would choose EB, of course), but it seems it's just too difficult without learn everything from EB first and then convert, eventually manually, ib std code to eb (if I convert first, as I haven't finished those 2 projects I am working, every fix, every new thing I code to add to those programs would force me to learn EB as well).

Any hint would be extremely well received :) Thank you in advance
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

Dennisc

Hi Joao

I do exactly what you are doing i.e. I first convert from IB Std to IB Pro using the convertor and then fix any errors thrown up by the EB compiler.

You don't say what errors are being returned by EB. If you could perhaps just list examples for us I am sure we can help.

The use of ÃÆ'Ã,§, ÃÆ'Ã,©, ÃÆ'Ã, , ÃÆ'Ã,­, etc. shuld not give any problems unless they are being used in EB's keywords (reserved words) or, in data names. If they are enclosed in strings they should be OK. Remember that an "ÃÆ'Ã, " for instance has a different ASCII code to an "a". Since evrything is happening at binary level, EB could be recognising the "ÃÆ'Ã, "'s code as something else.

Hope this makes sense. Post your code here and let's see if we can help

Regards
Dennis
Failure is only the opportunity to begin again more intelligently
www.denniscomninos.com

JoaoAfonso

August 15, 2007, 11:56:45 AM #2 Last Edit: August 15, 2007, 01:26:15 PM by Paul Turley
One of the examples is this one:
DECLARE "wsock32.dll",WSAStartup(wVR :int, lpWSAD:MEMORY),int
DECLARE "wsock32.dll",WSACleanup(),int
DECLARE "wsock32.dll",socket(af:int,s_type:int,protocol:int),int
DECLARE "wsock32.dll",bind(s:INT, addr:pointer, namelen:INT),INT
DECLARE "wsock32.dll",htons(hostshort:word),int
DECLARE "wsock32.dll",htonl(hostlong:INT),INT
DECLARE "wsock32.dll",listen(s:INT, backlog:INT),INT
DECLARE "wsock32.dll",send(s:int,buf:string,buflen:int,flags:int),int
DECLARE "wsock32.dll",recv(s:int,buf:string,buflen:int,flags:int),int
DECLARE "wsock32.dll",accept(s:INT, addr:int, addrlen:INT),INT
DECLARE "wsock32.dll",closesocket(s:INT),INT
DECLARE "wsock32.dll",WSAAsyncSelect(s:INT, hWnd:INT, wMsg:INT, lEvent:INT),INT
DECLARE "ws2_32.dll",WSAGetLastError(),INT
Declare "kernel32.dll",lstrcpyA(dest:STRING,source:INT),INT
Declare "user32.dll",FlashWindowEx(pfwi:pointer),int
DECLARE "advapi32",GetUserNameA(lpBuffer:String,nSize:pointer),int
DECLARE "ws2_32.dll",inet_ntoa(lIn:UINT),STRING
DECLARE "ws2_32.dll",getpeername(s:INT, name:sockaddr, namelen:pointer),INT
Declare GetIP(socnum:int)
DECLARE ConnectedUsers()
DECLARE AddSocket(socket:INT)

TYPE WSADataType
DEF   wVersion:WORD
DEF   wHighVersion:WORD
DEF   strDescription[256]:ISTRING
DEF   strSystemStatus[128]:ISTRING
DEF   iMaxSockets:INT
DEF   iMaxUdpDg:INT
DEF   lpVendorInfo:int
ENDTYPE

TYPE sockaddr_in
DEF   sin_family:word
DEF   sin_port:word
DEF   sin_addr:int
DEF   sin_zero[8]:ISTRING
ENDTYPE

TYPE flash
DEF   cbSize:INT
DEF   hwnd:INT
DEF   dwFlags:INT
DEF   uCount:INT
DEF   dwTimeout:INT
ENDTYPE

TYPE sockaddr_remote
DEF   sin_family:word
DEF   sin_port:word
DEF   sin_addr:int
DEF   sin_zero[8]:ISTRING
ENDTYPE

'-----------------------------------------
setid "WSVER2",         0x202
setid "NO_ERROR",      0
setid "AF_INET",      2
setid "SOCK_STREAM",   1
setid "IPPROTO_TCP",   6
setid "SOCKET_ERROR",   1
setid "INADDR_ANY",      0
setid "WinsockListenEvent",   1025
setid "WinsockClientEvent",   1026
setid "MaxConnections",   1
'-------------------------------WinSock notyfication
setid "FD_READ",      0x1
setid "FD_WRITE",      0x2
setid "FD_OOB",      0x4
setid "FD_ACCEPT",      0x8
setid "FD_CONNECT",      0x10
setid "FD_CLOSE",      0x20

DEF StructClient:sockaddr_remote
DEF StructServer:sockaddr_in
DEF StartupData:WSADataType
DEF Structflash:flash
DEF tempsd,mHost:MEMORY
ALLOCMEM tempsd,1,len(StartupData)
'FIM WINSOCKDEFS

'INICIO MUDDEFS
'mostrar texto tipo tabela, mas sem limites
DECLARE trimpad(papos:string,cnum:int,LR:string)
DECLARE editorgenerico(socketref:int)
DECLARE juliand(seci:int,mini:int,houri:int,dayi:int,monthi:int,yeari:int,secf:int,minf:int,hourf:int,dayf:int,monthf:int,yearf:int)
def resultado[4]:int
DECLARE isLeapYear(yyyy:int)
'modo de utilizaÃÆ'Ã,§ÃÆ'Ã,£o do juliand: juliand(resultado,a,b,c,...), com resposta nos valores: resultado[0] - seg, [1] - min, [2] - hora, [3] - dia
DECLARE enviarmsg(outstring:string,socket:int)
TYPE TERR
def pathdir:string
def path:string
def luznatural:int
def glance:string:'nome normal
def aweglance:string:'nome sem awareness
def describe[2000]:istring:'quando se for fazer print a esta string, fazer para calcular fim de linha (com um space) e depois muda de linha
def exits:string:' long exitsÂÃ,´short exitsÂÃ,´
'para npcaqui e eqaqui: 4 - todo o dia; 3 - todo o dia menos noite escura; 2 - nascer ao por do sol; 1 - sÃÆ'Ã,³ durante quase pico do sol; 0 - pico do sol
def npcaqui[41]:string:' nÂÃ,ºÃ‚Ã,´NPC nome todoÂÃ,´nome curtoÂÃ,´fileÂÃ,´nome chamada1ÂÃ,´nome chamada2ÂÃ,´nome chamada3ÂÃ,´
def eqaqui[41]:string:' nÂÃ,ºÃ‚Ã,´EQ nome todoÂÃ,´nome curtoÂÃ,´fileÂÃ,´nome chamada1ÂÃ,´nome chamada2ÂÃ,´nome chamada3ÂÃ,´
def pcaqui[41]:string:' nÂÃ,º:0 aparece, 1 fade/hideÂÃ,´PC nome todoÂÃ,´nome curtoÂÃ,´socketÂÃ,´
'var debaixo tem de ter o sistema de, quando chega ao X caracteres, qd encontra o 1ÂÃ,º space muda de linha
def frasecomtimer[2000,11]:istring
'pÃÆ'Ã,´r nas var debaixo looks, etc. 1otherlookÂÃ,´2otherlookÂÃ,´respostaÂÃ,´reacÃÆ'Ã,§ÃÆ'Ã,£o se houverÂÃ,´
def otherlook[2000,16]:istring
' var de baixo: exit por extensoÂÃ,´exit abreviadaÂÃ,´file do novo terrainÂÃ,´frase que aparece quando se mudaÂÃ,´
def exit[2000,16]:istring
def areamuchdense:int:'0 nÃÆ'Ã,£o, 1 sim
def weather:int:'DEFINE A QUE TIPO DE REGIÃÆ'Æ’O PERTENCE EM TERMOS DE METEREOLOGIA. VOU CONSIDERAR 4 TIPOS (DO 1 AO 4, CADA VEZ MELHOR TEMPO)
def awepts:int:'qts pts de awareness, no mÃÆ'Ã,­nimo, para ver a descriÃÆ'Ã,§ÃÆ'Ã,£o correcta
def kindofterrain:string:'none, forest, desert, mountain, Brushland, Grassy Hills, Forested Hills, Marsh, Chaparral, Fields, Plains, Beach
def slotplanted[11]:string:'tag do ficheiro de semente que estiver cÃÆ'Ã,¡ plantado
def tamanhoroom:int:'padrÃÆ'Ã,£o=2000, para significar 2000m
def oqueeagora[5000]:istring
ENDTYPE

def terrain:terr


TYPE PC
    DEF nome,legendinfo,password,prof,raca:string
def describe[2000]:istring
    DEF align:INT
def gender:string
    DEF surname:string
    DEF hp,eend:INT
    DEF maod,maoe:string
'inicio de slots/layers do inventory do char
    DEF bracos[4]:string
    DEF pes[4]:string
def cabeca[4]:string
def tronco[4]:string
def costas[4]:string
def cintura:string
def pernas[4]:string
def maos[4]:string
    DEF anel[4]:string
def colar[4]:string
'fim de slots/layers do inventory do char
def dia,hora,minuto,segundo:int
def ageatlogind,ageatloginh,ageatloginm,ageatlogins:int
def gold,eexp,wimpy:int
def skill[31]:string:'estas var, mais as 2 de baixo, sÃÆ'Ã,£o genÃÆ'Ã,©ricas mas p dps se tratar e mudar p nome prÃÆ'Ã,³prio, qd se souber quais sÃÆ'Ã,£o mm
def skillp[31]:int
def skillpmod[31]:int:'pontos da skill modificados por uso de equipment, por exemplo
def skillpuso[31]:int
def comida,bebida:int
def pesoactual:int
def visaomaxima:int:'ds
def visaominima:int:'dsa
def terreno:string
def anost,messt,diast,horast,minst,segst,segundolaston,minutolaston,horalaston,dialaston,meslaston,anolaston:int
def lvlquest:int
def loggedonoff:int
def brief:int
def socket:int
def anocr,mescr,diacr:int
def diacrext:string
def horacr,mincr,segcr:int
def ooccomm:int:'se 1 ligada, se 0 desligada
def admin:int:'1, 2 ou 3 se administrador, 0 se nÃÆ'Ã,£o ÃÆ'Ã,©
def modoeditor[2000]:istring
def textodoeditor[151]:string
def deflanguage:string
def defnews:string
'saber se estÃÆ'Ã,¡ afk ou nÃÆ'Ã,£o, para aparecer tag, e tempo para dizer ÃÆ'Ã,  quanto estÃÆ'Ã,¡ afk
def afk,afks,afkm,afkh,afkd,afkme,afka:int:'volÃÆ'Ã,¡til
def afkreason:string:'volÃÆ'Ã,¡til
def snoop:int
def invisible:int
def silence:int
def directory:string:'volÃÆ'Ã,¡til
def copysetdir:string:'volÃÆ'Ã,¡til
ENDTYPE

'LISTA DE PLAYER SKILLS
'SKILLS GERAIS
'- 1 - awareness
'LÃÆ'Ã,NGUAS - ver "etnologia da iberia.pdf"
'- 5 - lÃÆ'Ã,­ngua latina - latin (romanos)
'- 6 - lÃÆ'Ã,­ngua turdetana - turdetan (sul)
'- 7 - lÃÆ'Ã,­ngua ibÃÆ'Ã,©rica - iberic
'- 8 - lÃÆ'Ã,­ngua cÃÆ'Ã,©ltica - celtic
'- 9 - lÃÆ'Ã,­ngua prÃÆ'Ã,©-celta - lusitan
'- 10 -
'- 11 -

TYPE NPC
def tipo:string:'npc - monster; nokill - nÃÆ'Ã,£o morre; horse - cavalo; trainer - treinador; shopkeeper - dono de loja
def standardtext:string:'linha standard que aparece no terreno qd esta NPC estÃÆ'Ã,¡ presente - sÃÆ'Ã,³ depois variarÃÆ'Ã,¡ ficheiro .txt
def describe[2000]:istring:'quando se for fazer print a esta string, fazer para calcular fim de linha (com um space) e depois muda de linha
def name,VARIAVELVAZIA1,VARIAVELVAZIA2:string:'nomes reais
def skill[21]:string:'skills p serem usadas no futuro, juntamente com linha de baixo
def skillp[21]:int
def awareness:int
def align:int
def gender:string:'male ou female
def armed:int:'0 weapon wielded, 1 weapon disarmed
def eexp:int
def gold:int
def race:string
def language:string
def hp,eend,hpmax,eendmax:int
def equipamento[11]:string:'   nome que aparece`nome para chamar 1`nome para chamar 2`ficheiro`wield/ /worn`
'frase - se tiver #, considera um temp tell e actua com language; se nÃÆ'Ã,£o tiver, mostra sÃÆ'Ã,³ a frase. Exemplo:
'"a man says#: %hello!" - "a man says in lusitan: hello!"/"a man says in a strange tongue: vfiwq!"
def frasecomtimer[500,11]:istring
'frase - se tiver #, considera um temp tell e actua com language; se nÃÆ'Ã,£o tiver, mostra sÃÆ'Ã,³ a frase. Exemplo:
'"a man says#: %hello!" - "a man says in lusitan: hello!"/"a man says in a strange tongue: vfiwq!"
def fraseemcombate[500,6]:istring
def reaccaoqdvepc[6]:string
def fraseautoattack:string
def hunt:int:' 1 se faz hunt, 0 se nÃÆ'Ã,£o
def blocksaidaroom:int:' 1 se sim, 0 se nÃÆ'Ã,£o
def quemataca[21]:string
def caminhoronda:string:'dir curtaÂÃ,´dir curtaÂÃ,´dir curta...
def temporoomcaminhoronda:int
'pÃÆ'Ã,´r nas var debaixo looks, asks, etc, que sÃÆ'Ã,³ aparecem qd NPC existe.
'1otherlook`2otherlook`resposta`reacÃÆ'Ã,§ÃÆ'Ã,£o se houver`1 se tds no room veem resposta ou 0 se nÃÆ'Ã,£o`
def otherlook[2000,11]:istring
ENDTYPE

def npcmod:npc


TYPE ITEM
def tipo:string:'weapon, pack, shield, helmet, ring, bean, gold, corpse
def tipoespecifico:string
'- WEAPON - longsword, broadsword, bastard sword, cutlass, sabre, scimitar, shortsword, dagger, rapier, greatsword, mace, hammer,
' club, spiked, morning stars, axe, spear, long pike, short pike - CHECKAR SE EXISTEM ESTES TIPOS!
'- BEAN - tipo de semente: wheat - CHECKAR COLHEITAS DA ALTURA! BOLOTAS
def standardtext:string:'linha standard que aparece no terreno qd esta ITEM estÃÆ'Ã,¡ presente - sÃÆ'Ã,³ depois variarÃÆ'Ã,¡ ficheiro .txt
def describe[2000]:istring
def name:string:'nomes reais
def pricenew:int:'quanto vale nova
def uso:int:'variÃÆ'Ã,¡vel de uso para, nas lojas, baixar preÃÆ'Ã,§o. Se arma combate muito, esta sobe e o preÃÆ'Ã,§o na loja irÃÆ'Ã,¡ ter em conta o pricenew,
'o uso e a variÃÆ'Ã,¡vel da prÃÆ'Ã,³pria loja. O uso aumenta com a utilizaÃÆ'Ã,§ÃÆ'Ã,£o da item.
def bulk:int:'quanto ocupa em tamanho, por comparaÃÆ'Ã,§ÃÆ'Ã,£o a um item bem conhecido e facilmente comparÃÆ'Ã,¡vel
def weight:int:'quanto pesa - se acima de X peso, usa sempre 2 mÃÆ'Ã,£os para pegar, em gramas ou kilogramas
def emotes[11]:string:'emotes, se for arma
def frasewield:string:'frase quando se faz wield ou worn a espada ou armadura/pack/escudo/...
def fraseremove:string:'frase quando se faz remove ÃÆ'Ã,  item
def bodypartlayer:string:'string que contÃÆ'Ã,©m todas as bodyparts que utiliza, bem como as layers. Se fÃÆ'Ã,´r braÃÆ'Ã,§os e pernas da layer 3, a string
'poderÃÆ'Ã,¡ ser "be3bd3pe3pd3"; quando mud tiver de checkar faz instr para o que pretende, e saca tudo
' - bodyparts: cabeÃÆ'Ã,§a, braÃÆ'Ã,§o d, braÃÆ'Ã,§o e, mÃÆ'Ã,£o d, mÃÆ'Ã,£o e, ombro d, ombro e, peito, tronco, costas (sÃÆ'Ã,³ pack, sÃÆ'Ã,³ 1 layer), cintura, perna d, perna e,
' pÃÆ'Ã,© d, pÃÆ'Ã,© e, colar, anel
' - layers por bodypart: 3
def skill[21]:string:'skills p serem usadas no futuro, juntamente com linha de baixo
def skillp[21]:int
'- WEAPON - hitsperturn
'   - twohands
'- SHIELD - shieldhitopponent
'- BEAN - terrainfit (terreno ideal p cultura - corta 50% ao resultado final se diferente) - none 0, forest 1, desert 2, mountain 3 (ver TERR)
' - weatherlimitup, weatherlimitdown (baliza para ideal weather - por ponto fora, reduz 1% ao resultado final)
' - harvestlimitup, harvestlimitdown (baliza para time to harvest - por ponto fora, reduz 1% ao resultado final)
' - price100 (preÃÆ'Ã,§o a que se vai vender colheita se resultado a 100%)
' - planted (se 1 estÃÆ'Ã,¡, e comeÃÆ'Ã,§a a somar weathersum; se 0 nÃÆ'Ã,£o estÃÆ'Ã,¡ e nÃÆ'Ã,£o soma weathersum)
' - weathersum (valor da soma dos vÃÆ'Ã,¡rios weather, uma vez semente plantada)
' - nameharvested (nome depois de feita a colheita - CORRIGIR PORQUE O SKILL PODE SER ESTE, MAS O SKILLP ÃÆ'ââ,¬Â° SÃÆ'ââ,¬Å" P INTS!)
' - priceharvested (valor depois de feita a colheita, tendo em conta o PRICE100)
def otherlook[2000,11]:istring
'pÃÆ'Ã,´r nas var debaixo looks, etc,  que sÃÆ'Ã,³ aparecem qd ITEM estÃÆ'Ã,¡ presente
'1otherlook`2otherlook`resposta`reacÃÆ'Ã,§ÃÆ'Ã,£o se houver`1 se tds no room veem resposta ou 0 se sÃÆ'Ã,³ wielder`
def frasecomtimer[500,6]:istring
'frase`1 ou 0` - a frase ÃÆ'Ã,© a frase; se for 1, ela sÃÆ'Ã,³ aparece ao dono; se for 0, aparece a todos no room - POR ESTAS VAR?
ENDTYPE

def itemmod:item


DECLARE frasemoral() as string
DECLARE charquit(numberfromtable:int,reason:int)
DECLARE carregarpersonagem(nomepn:pc)
DECLARE guardarpersonagem(nomepn:pc)
DECLARE carregarnpc(nomenpc:string) as int
DECLARE guardarnpc(nomenpc:string)
DECLARE entraterreno(nchar:int,ficheironpc:string,terreno:string)
DECLARE saiterreno(nchar:int,ficheironpc:string,terreno:string)
DECLARE printterreno(nchar:int,terreno:string)
DECLARE carregarterreno(terreno:string)
DECLARE infopplroom(nchar:int,terreno:string,frase:string)
DECLARE infoiberia(ooc:int,frase:string):'se ooc=1 ÃÆ'Ã,© sÃÆ'Ã,³ para quem tem ooc line
'INICIO DE DEFS PARA DIRECTORY STRUCTURE ONLINE
CONST FILE_ATTRIBUTE_ARCHIVE = &H20
CONST FILE_ATTRIBUTE_COMPRESSED = &H800
CONST FILE_ATTRIBUTE_DEVICE = &H40
CONST FILE_ATTRIBUTE_DIRECTORY = &H10
CONST FILE_ATTRIBUTE_ENCRYPTED = &H4000
CONST FILE_ATTRIBUTE_HIDDEN = &H2
CONST FILE_ATTRIBUTE_NORMAL = &H80
CONST FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = &H2000
CONST FILE_ATTRIBUTE_OFFLINE = &H1000
CONST FILE_ATTRIBUTE_READONLY = &H1
CONST FILE_ATTRIBUTE_REPARSE_POINT = &H400
CONST FILE_ATTRIBUTE_SPARSE_FILE = &H200
CONST FILE_ATTRIBUTE_SYSTEM = &H4
CONST FILE_ATTRIBUTE_TEMPORARY = &H100
DECLARE "kernel32.dll",GetFileAttributesA(lpFileName:STRING),INT
'FIM DE DEFS PARA DIRECTORY STRUCTURE ONLINE
'FIM MUDDEFS

'INICIO DE DEFS LINHA DE COMANDOS
SETID "ENMKEYEVENTS",0x10000
SETID "ENMSGFILTER",0x700
TYPE MSGFILTER
def hwndFrom:INT
def idFrom:INT
def code:INT
def msg:INT
def wparam:INT
def lparam:INT
ENDTYPE
DEF mf:MSGFILTER
DEF mem:MEMORY
'FIM DE DEFS DE LINHA DE COMANDOS

DECLARE printf(text:string)
def d1:dialog
DIALOG d1,0,0,700,500,0x80CA0080,0,"Iberia Server Window",HandlerUser
CONTROL d1,"E,,0,0,700,485,0x50A00004,1"
CONTROL d1,"RE,,0,485,700,15,@CTEDITMULTI|@VSCROLL|@CTEDITRETURN,2"






def MaxSockets,event:int




DEF iResult,m_socket,ListenOut,Ready,WinSock,LenName,check,check2,check3,razao:int
DEF INVALID_SOCKET,host,addr,RetSel,ReceivedBytes,SelectOps:int
def backupfile:file
DEF Port:word
DEF bufor[32768],helpstring[32768]:istring
DEF WelcomeMessage,KickMessage,PingMessage,localname,UserName,MyIP:string
def BuforPointer,AddrPointer,NULLPointer:pointer
def texto,texto2,texto3,path,pathnpc,patheq,pathclone,pathpc,pathterr,volatil,volatil2,volatil3,volatil4:string
def hertbeattimer,visaototal,visaodia:int
def linhascreen,temp:string
def anoupt,mesupt,diaupt,horaupt,minupt,segupt:int
DEF dir,dir2,boiint,col1,col2,col3,col4,boi2,temp1,temp2:INT
DEF dirfile,dirfile2,vaca,boi:STRING
linhascreen="+-------------------------------------------------------------------------------+"
def gen1,gen2,genpc,gennpc,geneq,genclone,genterr:file
def textodaalturadodia,textoprint,textometereologia[5],textometereologiaprint[5]:string
def metereologian[5]:int
def counterfraseterreno,randomfraseterreno,countermetereologia,fasedodia,counternpctell,randomfrasenpctell,counterautosave:int
def terraintype[5],tt,serverlcerror,segtemp,mintemp,horatemp,diatemp,counteralturadodia,divisaodia:int
def tmp,tm,passd1,passd2,passd3:string
def tmn:int
def exitext,exitabrev,filenovoterr,frase,news1,news2,news3,news4,tell1,tell2,emote1,emote2,emote3,temporario:string
def pos1,pos2,pos3,pos4,pos5,pos6,pos7,error:int

counterfraseterreno=0:randomfraseterreno=0:countermetereologia=0:serverlcerror=0
'define o valor mÃÆ'Ã,©dio para os 4 tipos de metereologia por ÃÆ'Ã,¡rea
terraintype[1]=3
terraintype[2]=4
terraintype[3]=5
terraintype[4]=6
for c=1 to 4
tt=terraintype[c]
gosub metereologia
textometereologiaprint[c]=tmp
textometereologia[c]=tm
next c
textodaalturadodia = "The sun is rising on the eastern horizon.":visaodia = -10:fasedodia=2
textoprint="The sun appears at the edge of the eastern sky."
counteralturadodia=1
divisaodia=1
counternpctell=0
counterautosave=0

path=getstartpath+"data\"
pathnpc=getstartpath+"data\npc\"
patheq=getstartpath+"data\eq\"
pathclone=getstartpath+"data\clone\"
pathpc=getstartpath+"data\pc\"
pathterr=getstartpath+"data\terrain\"

BuforPointer=bufor : NULLPointer=0 : LenName=255
WelcomeMessage="iberiastart.sup"
KickMessage="Maximum players in Iberia already reached. Please visit us later!"
PingMessage=""
AddrPointer = addr
INVALID_SOCKET=-1
Port=5900
heartbeattimer=1000
SelectOps=@FD_READ|@FD_WRITE|@FD_ACCEPT|@FD_CONNECT|@FD_CLOSE
MaxSockets=10

'a linha de baixo ÃÆ'Ã,© +2 pq 1 ÃÆ'Ã,© por causa dos for a=1 to qq coisa e o outro ÃÆ'Ã,© para fazer o load a um char temporÃÆ'Ã,¡rio
def SockChar[MaxSockets+2]:pc:'nome temporÃÆ'Ã,¡rio dos sockets livres, tendo em conta o nÃÆ'Ã,ºmero de jogadores mÃÆ'Ã,¡ximo

def SockTable[MaxSockets]:int
def SockTableName[MaxSockets]:string
def SocketLC[MaxSockets]:string
def SockEstado[MaxSockets+2]:int
def SocketPassTemp[MaxSockets]:string
def terrenosdosplayers[maxsockets]:string


for a=0 to MaxSockets-1
SocketLC[a]=""
SockTable[a]=0
SockTableName[a]=""
SockEstado[a]=0
SocketPassTemp[a]=""
terrenosdosplayers[a]=""
sockchar[a].afk=0
next a

showdialog d1 : Ready=1
   Structflash.cbSize=len(StructFlash)
   Structflash.hwnd=d1
   Structflash.dwFlags=7|12
   Structflash.uCount=0
   Structflash.dwTimeout=0
waituntil Ready=0

' Canceling socket-notyfications and closing all used sockets
for addr=0 to MaxSockets-1
WSAAsyncSelect(SockTable[addr], d1, 0, 0)
closesocket(SockTable[addr])
next addr

WSACleanup()
freemem tempsd : closedialog d1
END


sub AddSocket(socket)
def x:int
for x=0 to MaxSockets-1
if SockTable[x]<1
SockTable[x]=socket : SockEstado[x]=1: x=MaxSockets+1
endif
next x
return (x>MaxSockets) :' return 1 if succes, or 0 if fail
'--------------------------------------------------------------
sub ConnectedUsers()
def x,a,b,c,d,e,f,users:int
   for x=1 to MaxSockets-1
      if SockTable[x]>0 then users=users+1
   next x
return users
'-------------------------------------------------------------- dialog d1
sub HandlerUser
def event,x:int
def MessageToSend:string
select @class
case @idinitdialog
'INICIO DA LIMPEZA DO MUD (CASO TENHA CRASHADO, FAZ LIMPEZA DAS SUBDIRECTORIAS)
'reset ao clone
dir = FINDOPEN(pathclone+"*.")
IF(dir)
    DO
        dirfile = FINDNEXT(dir)
if (dirfile<>".")&(dirfile<>"..")
dir2 = FINDOPEN(pathclone+dirfile+"\*.*")
IF(dir2)
    DO
        dirfile2 = FINDNEXT(dir2)
DELETEFILE(pathclone+dirfile+"\"+dirfile2)
UNTIL dirfile2 = ""
FINDCLOSE dir2
ENDIF
endif
removedir(pathclone+dirfile)
UNTIL dirfile = ""
FINDCLOSE dir
ENDIF
createdir(path+"CLONE")
'FIM DA LIMPEZA DO MUD (CASO TENHA CRASHADO, FAZ LIMPEZA DAS SUBDIRECTORIAS)
SETFONT d1,"Courier New",8,400,0,1
' SETFONT d1,"Courier New",8,400,0,2
starttimer d1,200,3
starttimer d1,heartbeattimer,1
centerwindow d1
CONTROLCMD d1,2,@RTSETEVENTMASK,@ENMKEYEVENTS
SETFOCUS d1,2
setcontroltext d1,2,""
segupt=val(mid$(time$,7,2))
minupt=val(mid$(time$,4,2))
horaupt=val(left$(time$,2))
diaupt=val(date$("d"))
mesupt=val(date$("M"))
anoupt=val(date$("yyyy"))
case @idclosewindow
gosub mudquit
serverlcerror=1
ready=0
case @WinsockListenEvent
event=@code
' printf("*** WinsockListenEvent: "+hex$(event))
gosub ClientWelcome
case @WinsockClientEvent
event=@code
' printf("*** WinsockClientEvent: "+hex$(event))
gosub ClientEvent
case @idcontrol
if @controlid=2
IF @NOTIFYCODE = @ENMSGFILTER
mem = @QUAL
READMEM mem,1,mf
If mf.msg = @IDKEYDOWN
mykey = mf.wparam
IF mykey = 0x0D
MessageToSend=left$(CONTROLCMD(d1,2,@RTGETLINE,CONTROLCMD(d1,2,@RTGETLINECOUNT)-1),len(CONTROLCMD(d1,2,@RTGETLINE,CONTROLCMD(d1,2,@RTGETLINECOUNT)-1))-2)
if MessageToSend<>""
printf("> "+messagetosend)
select messagetosend:'server LC
case "commands"
printf(linhascreen)
printf("                                COMMANDS AVAILABLE")
printf(linhascreen)
printf("* - 'reboot' to reboot MUD.")
printf("- 'quit' to exit the MUD machine.")
printf("- 'disconnect <socket>' to make <socket> character quit the MUD.")
printf("- 'chars list' to list every character and, if logged on, the socket and IP.")
printf("- 'delete <player>' to delete an existant character.")
printf("- 'ip <socket>' to return the ip associated to socket.")
printf(linhascreen)
serverlcerror=1
case "quit"
gosub mudquit
serverlcerror=1
ready=0
case "chars list"
printf(linhascreen)
printf("                                 CHARACTERS LIST")
printf(linhascreen)
boiint=0
col1=20:col2=10:col3=15
printf(trimpad("NAME",col1,"R")+trimpad("SOCKET",col2,"R")+trimpad("IP",col3,"R"))
dir = FINDOPEN(pathpc+"*.")
IF(dir)
    DO
        dirfile = FINDNEXT(dir)
if (dirfile<>".")&(dirfile<>"..")&(dirfile<>"")
for x=1 to maxsockets-1
if ucase$(SockTableName[x])=ucase$(dirfile) then boiint=x
next x
if boiint<>0
printf(trimpad(dirfile,col1,"R")+trimpad(ltrim$(str$(socktable[boiint])),col2,"R")+trimpad(getip(socktable[boiint]),col3,"R"))
else
printf(trimpad(dirfile,col1,"R"))
endif
boiint=0
endif
UNTIL dirfile = ""
FINDCLOSE dir
for x=1 to maxsockets-1
if (SockTableName[x]="")&(socktable[x]<>0) then printf(trimpad("Unknown",col1,"R")+trimpad(ltrim$(str$(socktable[x])),col2,"R")+trimpad(getip(socktable[x]),col3,"R"))
next x
ENDIF
printf(linhascreen)
serverlcerror=1
endselect
if left$(messagetosend,3)="ip "
temp=""
for x=0 to MaxSockets-1
if right$(messagetosend,len(messagetosend)-2)=str$(SockTable[x])
printf("*** Ip from socket"+str$(SockTable[x])+" is "+GetIp(SockTable[x])+".")
temp="certo"
endif
next x
if temp="" then printf("*** Socket not found.")
temp="":serverlcerror=1
endif
if left$(messagetosend,11)="disconnect "
tempint=val(right$(messagetosend,len(messagetosend)-11))
check=0
if tempint<>0
for a=1 to maxsockets-1
if tempint=socktable[a]
enviarmsg("Your character was forced to disconnect.",socktable[a])
if socktablename[a]=""
printf("*** Someone was forced to disconnect in socket"+str$(socktable[a])+".")
check=1
else
printf("*** "+socktablename[a]+" was forced to disconnect in socket"+str$(socktable[a])+".")
guardarpersonagem(sockchar[a])
check=1
endif
saiterreno(a,"",sockchar[a].terreno)
charquit(a,1)
endif
next a
endif
if check=0 then printf("*** No character found in socket"+str$(tempint))
serverlcerror=1
endif
if left$(messagetosend,7)="delete "
check=0
temp=right$(messagetosend,len(messagetosend)-7)
dir = FINDOPEN(pathpc+"*.")
IF(dir)
    DO
        dirfile = FINDNEXT(dir)
if ucase$(dirfile)=ucase$(temp)
dir2 = FINDOPEN(pathpc+dirfile+"\*.*")
IF(dir2)
    DO
for a=1 to maxsockets-1
if ucase$(dirfile)=ucase$(socktablename[a])
enviarmsg("Your character was deleted.",socktable[a])
saiterreno(a,"",sockchar[a].terreno)
charquit(a,1)
check=1
endif
next a
        dirfile2 = FINDNEXT(dir2)
DELETEFILE(pathpc+dirfile+"\"+dirfile2)
UNTIL (dirfile2="")|(check=1)
FINDCLOSE dir2
ENDIF
removedir(pathpc+dirfile)
printf("*** "+dirfile+" was deleted.")
check=1
endif
UNTIL (dirfile="")|(check=1)
FINDCLOSE dir
ENDIF
if check=0 then printf("*** Character "+temp+" not found.")
check=0:serverlcerror=1
endif
if serverlcerror=0 then printf("Command not recognized.")
setcontroltext d1,2,"":serverlcerror=0
endif
ENDIF
endif
ENDIF
endif
case @idtimer
select @code
case 1:'heartbeattimer - checka segundo a segundo
'para autosave e checkar ip para deitar abaixo no pingings: 15 em 15 minutos
counterautosave=counterautosave+1
if counterautosave=900
for c=1 to maxsockets-1
if SockTable[c]<>0:'checkar no pingings
if send(SockTable[c],PingMessage,len(PingMessage)+1,5)<>len(PingMessage)+1
if SockTableName[c]=""
charquit(c,4)
else
if sockchar[c].terreno<>""
saiterreno(c,"",sockchar[c].terreno)
infopplroom(c,sockchar[c].terreno,sockchar[c].nome+" left Iberia (no pinging).")
endif
charquit(c,4)
endif
endif
endif
if SockTableName[c]<>"":'checkar autosave
guardarpersonagem(sockchar[c])
endif
counterautosave=0
next c
endif
'frases random de npc - 2 em 2 minutos
counternpctell=counternpctell+1
if counternpctell=120
counternpctell=0
'checkar quais os terrenos ocupados por PC para enviar NPC TEMP TELLS; terrenosdosplayers[x], de 1 a maxsockets-1
gosub checkaterrenosocupados
for c=1 to maxsockets-1
if terrenosdosplayers[c]<>""
carregarterreno(""+terrenosdosplayers[c])
for d=1 to 40
if terrain.npcaqui[d]<>""
pos1=instr(terrain.npcaqui[d],"`")
pos2=instr(pos1+1,terrain.npcaqui[d],"`")
pos3=instr(pos2+1,terrain.npcaqui[d],"`")
pos4=instr(pos3+1,terrain.npcaqui[d],"`")
pos5=instr(pos4+1,terrain.npcaqui[d],"`")
pos6=instr(pos5+1,terrain.npcaqui[d],"`")
pos7=instr(pos6+1,terrain.npcaqui[d],"`")
carregarnpc(mid$(terrain.npcaqui[d],pos3+1,pos4-pos3-1))
randomfrasenpctell=int(rnd(11))
if (randomfrasenpctell=1)&(npcmod.frasecomtimer[0,1]<>"") then check=1
if (randomfrasenpctell=2)&(npcmod.frasecomtimer[0,2]<>"") then check=2
if (randomfrasenpctell=3)&(npcmod.frasecomtimer[0,3]<>"") then check=3
if (randomfrasenpctell=4)&(npcmod.frasecomtimer[0,4]<>"") then check=4
if (randomfrasenpctell=5)&(npcmod.frasecomtimer[0,5]<>"") then check=5
if (randomfrasenpctell=6)&(npcmod.frasecomtimer[0,6]<>"") then check=6
if (randomfrasenpctell=7)&(npcmod.frasecomtimer[0,7]<>"") then check=7
if (randomfrasenpctell=8)&(npcmod.frasecomtimer[0,8]<>"") then check=8
if (randomfrasenpctell=9)&(npcmod.frasecomtimer[0,9]<>"") then check=9
if (randomfrasenpctell=10)&(npcmod.frasecomtimer[0,10]<>"") then check=10
if (npcmod.frasecomtimer[0,check]<>"")&(randomfrasenpctell<>0)
if instr(npcmod.frasecomtimer[0,check],"#")<>0
pos1=instr(npcmod.frasecomtimer[0,check],"#")
pos2=instr(pos1+1,npcmod.frasecomtimer[0,check],"%")
for e=1 to maxsockets-1
if (sockchar[e].terreno=terrenosdosplayers[c])&(sockestado[e]=10)
check2=0
for f=5 to 11
if (ucase$(npcmod.language)=ucase$(sockchar[e].skill[f]))&(check2=0)
volatil=left$(npcmod.frasecomtimer[0,check],pos1-1)+" in "+npcmod.language+mid$(npcmod.frasecomtimer[0,check],pos1+1,pos2-pos1-1)
check2=f
endif
if check2=0 then volatil=left$(npcmod.frasecomtimer[0,check],pos1-1)+" in a strange tongue"+mid$(npcmod.frasecomtimer[0,check],pos1+1,pos2-pos1-1)
next f
if check2<>0
razao=100-sockchar[e].skillp[check2]+sockchar[e].skillpmod[check2]
if razao<0 then razao=0
else
razao=100
endif
volatil2=mid$(npcmod.frasecomtimer[0,check],pos2+1)
check2=len(volatil2)
volatil3=""
for f=1 to check2
if (mid$(volatil2,f,1)=" ")|(mid$(volatil2,f,1)="!")|(mid$(volatil2,f,1)="?")|(mid$(volatil2,f,1)=".")|(mid$(volatil2,f,1)=chr$(34))|(mid$(volatil2,f,1)=",")
volatil3=volatil3+mid$(volatil2,f,1)
else
check3=int(rnd(101))
if check3>=razao
'letra reconhecida
volatil3=volatil3+mid$(volatil2,f,1)
else
'letra nÃÆ'Ã,£o reconhecida
check3=int(rnd(25))
if check3=0 then check3=1
volatil3=volatil3+mid$("abcdefghijklmnopqrstuvwxyz",check3,1)
endif
endif
next f
enviarmsg(volatil+volatil3,socktable[e])
endif
next e
else
infopplroom(0,terrenosdosplayers[c],""+npcmod.frasecomtimer[0,check])
endif
endif
endif
next d
endif
next c
endif
'frases random de terreno - 3 em 3 minutos
counterfraseterreno=counterfraseterreno+1
if counterfraseterreno=180
counterfraseterreno=0
'checkar quais os terrenos ocupados por PC para enviar NPC TEMP TELLS; terrenosdosplayers[x], de 1 a maxsockets-1
gosub checkaterrenosocupados
for c=1 to maxsockets-1
if terrenosdosplayers[c]<>""
carregarterreno(""+terrenosdosplayers[c])
randomfraseterreno=int(rnd(11))
if (randomfraseterreno=1)&(terrain.frasecomtimer[0,1]<>"") then infopplroom(0,terrenosdosplayers[c],""+terrain.frasecomtimer[0,1])
if (randomfraseterreno=2)&(terrain.frasecomtimer[0,2]<>"") then infopplroom(0,terrenosdosplayers[c],""+terrain.frasecomtimer[0,2])
if (randomfraseterreno=3)&(terrain.frasecomtimer[0,3]<>"") then infopplroom(0,terrenosdosplayers[c],""+terrain.frasecomtimer[0,3])
if (randomfraseterreno=4)&(terrain.frasecomtimer[0,4]<>"") then infopplroom(0,terrenosdosplayers[c],""+terrain.frasecomtimer[0,4])
if (randomfraseterreno=5)&(terrain.frasecomtimer[0,5]<>"") then infopplroom(0,terrenosdosplayers[c],""+terrain.frasecomtimer[0,5])
if (randomfraseterreno=6)&(terrain.frasecomtimer[0,6]<>"") then infopplroom(0,terrenosdosplayers[c],""+terrain.frasecomtimer[0,6])
if (randomfraseterreno=7)&(terrain.frasecomtimer[0,7]<>"") then infopplroom(0,terrenosdosplayers[c],""+terrain.frasecomtimer[0,7])
if (randomfraseterreno=8)&(terrain.frasecomtimer[0,8]<>"") then infopplroom(0,terrenosdosplayers[c],""+terrain.frasecomtimer[0,8])
if (randomfraseterreno=9)&(terrain.frasecomtimer[0,9]<>"") then infopplroom(0,terrenosdosplayers[c],""+terrain.frasecomtimer[0,9])
if (randomfraseterreno=10)&(terrain.frasecomtimer[0,10]<>"") then infopplroom(0,terrenosdosplayers[c],""+terrain.frasecomtimer[0,10])
endif
next c
endif
'fase do dia - counter aumenta de 10 em 10 minutos
counteralturadodia=counteralturadodia+1
if counteralturadodia=600
counteralturadodia=0
divisaodia=divisaodia+1
gosub alturadodia
endif
'metereologia - muda de 9 em 9 minutos
countermetereologia=countermetereologia+1
if countermetereologia=540
countermetereologia=0
'checkar quais os terrenos ocupados por PC para enviar NPC TEMP TELLS; terrenosdosplayers[x], de 1 a maxsockets-1
gosub checkaterrenosocupados
for c=1 to 4
randommete=int(rnd(7))
if (randommete=>3)&(randommete<6)
randommete2=int(rnd(3))
if randommete2=2
select c
case (1)
if terraintype[1]=3
terraintype[1]=2
else
if terraintype[1]>3 then terraintype[1]=terraintype[1]+1
if terraintype[1]<3 then terraintype[1]=terraintype[1]-1
endif
if terraintype[1]>8 then terraintype[1]=8
if terraintype[1]<1 then terraintype[1]=1
case (2)
if terraintype[2]=4
terraintype[2]=3
else
if terraintype[2]>4 then terraintype[2]=terraintype[2]+1
if terraintype[2]<4 then terraintype[2]=terraintype[2]-1
endif
if terraintype[2]>8 then terraintype[2]=8
if terraintype[2]<1 then terraintype[2]=1
case (3)
if terraintype[3]=5
terraintype[3]=4
else
if terraintype[3]>5 then terraintype[3]=terraintype[3]+1
if terraintype[3]<5 then terraintype[3]=terraintype[3]-1
endif
if terraintype[3]>8 then terraintype[3]=8
if terraintype[3]<1 then terraintype[3]=1
case (4)
if terraintype[4]=6
terraintype[4]=5
else
if terraintype[4]>6 then terraintype[4]=terraintype[4]+1
if terraintype[4]<6 then terraintype[4]=terraintype[4]-1
endif
if terraintype[4]>8 then terraintype[4]=8
if terraintype[4]<1 then terraintype[4]=1
default
endselect
else
select c
case (1)
if terraintype[1]=3
terraintype[1]=4
else
if terraintype[1]>3 then terraintype[1]=terraintype[1]-1
if terraintype[1]<3 then terraintype[1]=terraintype[1]+1
endif
case (2)
if terraintype[2]=4
terraintype[2]=5
else
if terraintype[2]>4 then terraintype[2]=terraintype[2]-1
if terraintype[2]<4 then terraintype[2]=terraintype[2]+1
endif
case (3)
if terraintype[3]=5
terraintype[3]=6
else
if terraintype[3]>5 then terraintype[3]=terraintype[3]-1
if terraintype[3]<5 then terraintype[3]=terraintype[3]+1
endif
case (4)
if terraintype[4]=6
terraintype[4]=7
else
if terraintype[4]>6 then terraintype[4]=terraintype[4]-1
if terraintype[4]<6 then terraintype[4]=terraintype[4]+1
endif
default
endselect
endif
endif
if randommete=6
randommete2=int(rnd(3))
if randommete2=2
select c
case (1)
if terraintype[1]=3
terraintype[1]=2
else
if terraintype[1]>3 then terraintype[1]=terraintype[1]+2
if terraintype[1]<3 then terraintype[1]=terraintype[1]-2
endif
if terraintype[1]>8 then terraintype[1]=8
if terraintype[1]<1 then terraintype[1]=1
case (2)
if terraintype[2]=4
terraintype[2]=3
else
if terraintype[2]>4 then terraintype[2]=terraintype[2]+2
if terraintype[2]<4 then terraintype[2]=terraintype[2]-2
endif
if terraintype[2]>8 then terraintype[2]=8
if terraintype[2]<1 then terraintype[2]=1
case (3)
if terraintype[3]=5
terraintype[3]=4
else
if terraintype[3]>5 then terraintype[3]=terraintype[3]+2
if terraintype[3]<5 then terraintype[3]=terraintype[3]-2
endif
if terraintype[3]>8 then terraintype[3]=8
if terraintype[3]<1 then terraintype[3]=1
case (4)
if terraintype[4]=6
terraintype[4]=5
else
if terraintype[4]>6 then terraintype[4]=terraintype[4]+2
if terraintype[4]<6 then terraintype[4]=terraintype[4]-2
endif
if terraintype[4]>8 then terraintype[4]=8
if terraintype[4]<1 then terraintype[4]=1
default
endselect
else
select c
case (1)
if terraintype[1]=3
terraintype[1]=4
else
if terraintype[1]>3 then terraintype[1]=terraintype[1]-2
if terraintype[1]<3 then terraintype[1]=terraintype[1]+2
endif
case (2)
if terraintype[2]=4
terraintype[2]=5
else
if terraintype[2]>4 then terraintype[2]=terraintype[2]-2
if terraintype[2]<4 then terraintype[2]=terraintype[2]+2
endif
case (3)
if terraintype[3]=5
terraintype[3]=6
else
if terraintype[3]>5 then terraintype[3]=terraintype[3]-2
if terraintype[3]<5 then terraintype[3]=terraintype[3]+2
endif
case (4)
if terraintype[4]=6
terraintype[4]=7
else
if terraintype[4]>6 then terraintype[4]=terraintype[4]-2
if terraintype[4]<6 then terraintype[4]=terraintype[4]+2
endif
default
endselect
endif
endif
next c
for c=1 to 4
tt=terraintype[c]
gosub metereologia
textometereologiaprint[c]=tmp
textometereologia[c]=tm
metereologian[c]=tmn
next c
for c=1 to maxsockets-1
if terrenosdosplayers[c]<>""
carregarterreno(""+terrenosdosplayers[c])
temp=textometereologiaprint[terrain.weather]
infopplroom(0,terrenosdosplayers[c],temp)
endif
next c
'fim de metereologia
endif
case 3
setcaption d1,"Iberia MUD Server - Connected Users: "+str$(ConnectedUsers())
if WinSock=4 : WinSock=5 : starttimer d1,500,4 : AddSocket(m_socket)
if WSAAsyncSelect(m_socket,d1,@WinsockListenEvent,SelectOps)=0 then printf("***WSAAsyncSelect OK")
endif
if WinSock=3 then gosub WinsockListen
if WinSock=2 then gosub WinsockBind
if WinSock=1 then gosub WinsockSocket
if WinSock=0 then gosub WinsockStartup
case 4
stoptimer d1,4 : printf(time$+" Listening")
endselect
endselect
return
'------------------------------- SockTable[1 to MaxSockets-1]=connected socks table, SockTable[0]=listening sock
sub ClientWelcome
def AcceptSocket,clientport:int
AcceptSocket=accept(m_socket,StructClient,0)
if AcceptSocket<>INVALID_SOCKET
' FlashWindowEx(StructFlash)
printf(time$+" Client connected. Accepting...")
if AddSocket(AcceptSocket)
printf(time$+" Sending welcome screen to socket "+ltrim$(str$(AcceptSocket))+" (IP: "+GetIp(AcceptSocket)+")")
if (openfile(gen1,path+WelcomeMessage,"R")=0)
enviarmsg(" ",AcceptSocket)
do
if(read(gen1,texto) = 0)
enviarmsg(texto,AcceptSocket)
endif
until eof(gen1)
closefile gen1
endif
enviarmsg(frasemoral(),AcceptSocket)
enviarmsg("",AcceptSocket)
enviarmsg("Your name?",AcceptSocket)
WSAAsyncSelect(AcceptSocket,d1,@WinsockClientEvent,SelectOps)
else
printf(time$+" Server is full. Client will be not connected")
enviarmsg(KickMessage,AcceptSocket)
closesocket(AcceptSocket)
endif
endif
return
'-----------------------------------------------------------------
sub ClientEvent
def x:int
for x=1 to MaxSockets-1
if SockTable[x]>0
ReceivedBytes=recv(SockTable[x],Bufor,4096,0)
if ReceivedBytes>254
enviarmsg("That's a very big input! You would die breathless!",SockTable[x])
socketlc[x]=""
next x
endif
if ReceivedBytes>0
if instr(left$(bufor,ReceivedBytes),chr$(8))<>0
if socketlc[x]<>"" then socketlc[x]=left$(socketlc[x],len(socketlc[x])-1):'caso se carregue no DEL e a string nÃÆ'Ã,£o esteja vazia
else
if instr(left$(bufor,ReceivedBytes-1),chr$(13))=0
socketlc[x]=socketlc[x]+left$(bufor,ReceivedBytes)
else
if left$(bufor,ReceivedBytes),len(socketlc[x]+left$(bufor,ReceivedBytes))<2:'para tentar eliminar alguns erros de ligaÃÆ'Ã,§ÃÆ'Ã,£o ao MUD
enviarmsg("Error in client trying to accessing Iberia MUD.",socktable[x])
check=0:socketlc[x]=""
next x
endif
socketlc[x]=left$(socketlc[x]+left$(bufor,ReceivedBytes),len(socketlc[x]+left$(bufor,ReceivedBytes))-2)
if (sockchar[x].snoop<>0)
enviarmsg(ucase$(sockchar[x].nome)+" > "+socketlc[x],sockchar[x].snoop)
endif
'INICIO DE CHECKAR SE PERSONAGEM EXISTE, ÃÆ'ââ,¬Â° VÃÆ'Ã,LIDA, ETC
if sockestado[x]=1
if socketlc[x]="quit"
charquit(x,1)
socketlc[x]=""
next x
endif
if (ltrim$(socketlc[x])="")|(instr(socketlc[x]," ")<>0)
enviarmsg("Invalid name. Your name?",SockTable[x])
socketlc[x]=""
next x
endif
if (len(socketlc[x])<3)|(len(socketlc[x])>11)
enviarmsg("Your name must be within 3 and 11 characters. Your name?",SockTable[x])
socketlc[x]=""
next x
endif
socktablename[x]=socketlc[x]
if openfile(genpc,pathpc+socktablename[x]+"\"+socktablename[x]+".txt","R")=0
closefile genpc
SockChar[x].nome=socktablename[x]
carregarpersonagem(SockChar[x])
enviarmsg("Password:",SockTable[x])
sockestado[x]=8
socketlc[x]=""
enviarmsg("> ",socktable[x])
next x
else
if (openfile(gen1,path+"nonames.sup","R")=0)
do
if(read(gen1,texto) = 0)
if ucase$(texto)=ucase$(socktablename[x])
enviarmsg("That name is restricted, you must choose another one.",SockTable[x])
enviarmsg("Your name?",SockTable[x])
closefile gen1
socketlc[x]=""
next x
endif
endif
until eof(gen1)
closefile gen1
endif
socktablename[x]=lcase$(socktablename[x])
socktablename[x]=ucase$(left$(socktablename[x],1))+right$(socktablename[x],len(socktablename[x])-1)
enviarmsg("That player does not exist. If you wish to create a new character with",SockTable[x])
enviarmsg("that name, answer yes to the question below. To maintain a good roleplay",SockTable[x])
enviarmsg("environment, it is advisable to choose a thematic name but other than",SockTable[x])
enviarmsg("the names of real heros of that time. This is to prevent confusion.",SockTable[x])
enviarmsg("Is "+socktablename[x]+" the correct name?",SockTable[x])
sockestado[x]=2
socketlc[x]=""
enviarmsg("> ",socktable[x])
next x
endif
next x
endif
if sockestado[x]=2
select(socketlc[x])
case("no")
case("n")
sockestado[x]=1
enviarmsg("Your name?",SockTable[x])
case("yes")
case("y")
sockchar[x].nome=socktablename[x]
enviarmsg("To create a new character we need some information.",SockTable[x])
enviarmsg("Please choose a password: ",SockTable[x])
sockestado[x]=3
case("quit")
charquit(x,1)
default
enviarmsg("Bad choice, please type (y)es or (n)o.",SockTable[x])
endselect
socketlc[x]=""
enviarmsg("> ",socktable[x])
next x
endif
if sockestado[x]=3
socketpasstemp[x]=socketlc[x]
enviarmsg("Password (again): ",SockTable[x])
sockestado[x]=4
socketlc[x]=""
enviarmsg("> ",socktable[x])
next x
endif
if sockestado[x]=4
if socketpasstemp[x]<>socketlc[x]
enviarmsg("Invalid password.",SockTable[x])
enviarmsg("Please choose a password: ",SockTable[x])
sockestado[x]=3
socketlc[x]=""
enviarmsg("> ",socktable[x])
next x
else
sockchar[x].password=socketpasstemp[x]
enviarmsg("You can be (m)ale or (f)emale.",SockTable[x])
sockestado[x]=5
socketlc[x]=""
enviarmsg("> ",socktable[x])
next x
endif
endif
if sockestado[x]=5
if (ucase$(socketlc[x])<>"M")&(ucase$(socketlc[x])<>"F")&(ucase$(socketlc[x])<>"MALE")&(ucase$(socketlc[x])<>"FEMALE")
enviarmsg("Bad choice, please type (m)ale or (f)emale.",SockTable[x])
socketlc[x]=""
enviarmsg("> ",socktable[x])
next x
else
if socketlc[x]="quit"
charquit(x,1)
socketlc[x]=""
enviarmsg("> ",socktable[x])
next x
else
if(ucase$(socketlc[x])="M")|(ucase$(socketlc[x])="MALE")
sockchar[x].gender="male"
else
sockchar[x].gender="female"
endif
sockestado[x]=6
enviarmsg("",SockTable[x])
enviarmsg("In the 3rd century BC, Rome started its conquest of the Iberian Peninsulae, but focusing only their strength there after the end of Punic",SockTable[x])
enviarmsg("Wars. The invasion progressed quite well in its initial phases, conquering most of the peninsulae with relative ease.",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("The consul Servius Sulpicius Galba commanded the Roman troops in Iberia circa 150 BC and started destroying the rest of the Lusitan",SockTable[x])
enviarmsg("resistance. Fearing the destruction of their lands, the Lusitans sent an embassy to him. Galba received the Lusitan embassy politely, suspended the offensive and promised to give lands to the Lusitan people.",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("The offer turned out to be a trap. When the unarmed Lusitans tried to reclaim the lands promised by Galba, a massacre happened and many were killed. Viriathus was among those who escaped.",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("Viriathus never forgot the Roman treachery. Later, when some Lusitan leaders prepared to make a new agreement with the Romans after a major",SockTable[x])
enviarmsg("loss of lives to the Roman army of Caius Vetilius, Viriathus reminded them of Galba's trick and proposed a Lusitan War against the Romans. The Lusitans cried with joy.",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("Viriathus organized an attack against Caius Vetilius in Tribola. Since the Romans were better armed, he organized guerrilla tactics and sprung",SockTable[x])
enviarmsg("imaginative ambushes. Charging with iron spears, tridents and roars, the Lusitans defeated Vetilius. After him, the Lusitans clashed with the armies of Caius Plancius, Unimanus and Caius Nigidius.",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("To complete the pacification and humiliation of Lusitania, Rome sent Fabius Emilianus, with 15,000 soldiers and 2,000 horses, to strengthen",SockTable[x])
enviarmsg("Caius Lelius. The Romans lost most of these reinforcements in Ossuma. When Emilianus risked combat again, he was totally defeated near what is today",SockTable[x])
enviarmsg("the city of Beja in Alentejo. This defeat gave the Lusitans access to today’s Spanish territory, modern Granada and Murcia.",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("Please now choose an ethnic group:",SockTable[x])
enviarmsg(" lusitans",SockTable[x])
enviarmsg(" romans",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("To choose a group, just type '<group>'.",SockTable[x])
enviarmsg("To learn more about an ethnic group, type 'help <group>'.",SockTable[x])
socketlc[x]=""
enviarmsg("> ",socktable[x])
next x
endif
endif
endif
if sockestado[x]=6
select(socketlc[x])
case("lusitans")
sockchar[x].raca="lusitan":sockchar[x].visaomaxima=75:sockchar[x].visaominima=25:sockchar[x].terreno="herminius\herminius1.txt"
sockchar[x].skill[9]="Lusitan":sockchar[x].skillp[9]=100:sockchar[x].skillpuso[9]=0:sockchar[x].skillpmod[9]=0
sockchar[x].skill[8]="Celtic":sockchar[x].skillp[8]=50:sockchar[x].skillpuso[8]=0:sockchar[x].skillpmod[8]=0
sockchar[x].skill[7]="Iberic":sockchar[x].skillp[7]=20:sockchar[x].skillpuso[7]=0:sockchar[x].skillpmod[7]=0
sockchar[x].skill[5]="":sockchar[x].skillp[5]=0:sockchar[x].skillpuso[5]=0:sockchar[x].skill[6]="":sockchar[x].skillp[6]=0:sockchar[x].skillpuso[6]=0:sockchar[x].skill[10]="":sockchar[x].skillp[10]=0:sockchar[x].skillpuso[10]=0:sockchar[x].skill[11]="":sockchar[x].skillp[11]=0:sockchar[x].skillpuso[11]=0:
sockchar[x].align=0:sockchar[x].deflanguage="Lusitan"
goto fimescolharaca
case("romans")
sockchar[x].raca="roman":sockchar[x].visaomaxima=75:sockchar[x].visaominima=25:sockchar[x].terreno="herminius\herminius1.txt"
sockchar[x].skill[5]="Latin":sockchar[x].skillp[5]=100:sockchar[x].deflanguage="Latin"
for b=6 to 11
sockchar[x].skill[b]="":sockchar[x].skillp[b]=0:sockchar[x].skillpuso[b]=0:sockchar[x].skillpmod[b]=0
next b
sockchar[x].align=2000
goto fimescolharaca
case("help lusitans")
case("help romans")
default
enviarmsg("What?",SockTable[x])
endselect
socketlc[x]=""
enviarmsg("> ",socktable[x])
next x
label fimescolharaca
enviarmsg("You are now a "+sockchar[x].raca+".",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("Welcome to Iberia! Enjoy your time here and, most of all, HAVE FUN!",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("If you are a new player or you are not used to live in Iberia, please type",SockTable[x])
enviarmsg("'help start' and/or 'help' to get all information you need.",SockTable[x])
enviarmsg("",SockTable[x])
enviarmsg("You wake up from a cozy sleep, and find yourself in the roots of a mountain...",SockTable[x])
enviarmsg("",SockTable[x])
socktablename[x]=sockchar[x].nome
sockchar[x].socket=0
sockchar[x].legendinfo="":sockchar[x].prof="anonymous":sockchar[x].describe="":sockchar[x].surname="":sockchar[x].hp=50:sockchar[x].eend=50
sockchar[x].maod="":sockchar[x].maoe=""
for b=1 to 3
sockchar[x].bracos[b]="":sockchar[x].pes[b]="":sockchar[x].cabeca[b]="":sockchar[x].tronco[b]="":sockchar[x].costas[b]="":sockchar[x].pernas[b]="":sockchar[x].maos[b]="":sockchar[x].anel[b]="":sockchar[x].colar[b]=""
next b
sockchar[x].cintura="":sockchar[x].dia=0:sockchar[x].hora=0:sockchar[x].minuto=0:sockchar[x].segundo=0:sockchar[x].gold=0:sockchar[x].eexp=0:sockchar[x].wimpy=0
sockchar[x].skill[1]="Awareness":sockchar[x].skillp[1]=0:sockchar[x].skillpuso[1]=0
for b=12 to 29
sockchar[x].skill[b]="":sockchar[x].skillp[b]=0:sockchar[x].skillpuso[b]=0:sockchar[x].skillpmod[b]=0
next b
sockchar[x].comida=0:sockchar[x].bebida=0:sockchar[x].pesoactual=0:sockchar[x].segundolaston=0:sockchar[x].minutolaston=0:sockchar[x].horalaston=0:sockchar[x].dialaston=0:sockchar[x].meslaston=0:sockchar[x].anolaston=0:sockchar[x].lvlquest=0:sockchar[x].loggedonoff=1:sockchar[x].brief=0
sockchar[x].segst=val(mid$(time$,7,2))
sockchar[x].minst=val(mid$(time$,4,2))
sockchar[x].horast=val(left$(time$,2))
sockchar[x].diast=val(date$("d"))
sockchar[x].messt=val(date$("M"))
sockchar[x].anost=val(date$("yyyy"))
sockchar[x].ageatlogins=0
sockchar[x].ageatloginm=0
sockchar[x].ageatloginh=0
sockchar[x].ageatlogind=0
sockchar[x].segcr=val(mid$(time$,7,2))
sockchar[x].mincr=val(mid$(time$,4,2))
sockchar[x].horacr=val(left$(time$,2))
sockchar[x].diacrext=date$("ddd")
sockchar[x].diacr=val(date$("d"))
sockchar[x].mescr=val(date$("M"))
sockchar[x].anocr=val(date$("yyyy"))
sockchar[x].ooccomm=1:sockchar[x].admin=0:sockchar[x].modoeditor="":sockchar[x].defnews=""
sockchar[x].directory=path:sockchar[x].copysetdir="C:\"
for b=1 to 150
sockchar[x].textodoeditor[b]=""
next b
sockchar[x].afk=0:sockchar[x].afkreason="":sockchar[x].afks=0:sockchar[x].afkm=0:sockchar[x].afkh=0:sockchar[x].afkd=0:sockchar[x].afkme=0:sockchar[x].afka=0
createdir(pathpc+sockchar[x].nome)
guardarpersonagem(sockchar[x])
printf(time$+" "+ucase$(socktablename[x])+" is in socket "+ltrim$(str$(SockTable[x]))+" with the ip "+getip(SockTable[x])+".")
entraterreno(x,"",sockchar[x].terreno)
infopplroom(x,sockchar[x].terreno,sockchar[x].nome+" enters Iberia.")
for a=1 to maxsockets-1
if (getip(socktable[x])=getip(socktable[a]))&(socktable[x]<>socktable[a])&(socktablename[x]<>"")&(socktablename[a]<>"")
printf("MULTIPLAY IN IP "+getip(socktable[x])+"! Characters: "+socktablename[x]+" and "+socktablename[a]+" (sockets"+str$(socktable[x])+" and"+str$(socktable[a])+")")
endif
next a
sockestado[x]=10
if (openfile(gen1,path+"news.sup","R")=0)
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

Dennisc

Yikes!  :)

A bit longer than I imagined - saw 4k and assumed it would be a short one. I see you are calling the wsock32.dll routine - anybody out there have experience using it?

It's late night here in South Africa so don't have time to look at it now. Perhaps a late owl or early bird in another time-zone can have a go at it in the interim.

Dennis
Failure is only the opportunity to begin again more intelligently
www.denniscomninos.com

Ionic Wind Support Team

Better to post it as a .zip, or at least show a single line where you are having problems. You exceeded the boards post limit.
Ionic Wind Support Team

LarryMc

yelp!,
I loaded it in the compiler and everything after the 3rd line of the ClientEvent subroutine is corrupted.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

JoaoAfonso

*nod*
It's a 4k line program first of all. Then that's what I believe I figured out: when translating to pro and changing to ebasic, it gives error right at the begining.

Just translated this fraction:
'Code converted with S2P v1.03 on the 15-AUG-2007 at 23:00:27

$MAIN
AutoDefine "Off"
Def Version$:String:Version$=""
DECLARE "wsock32.dll",WSAStartup(wVR :int, lpWSAD:MEMORY),int   
DECLARE "wsock32.dll",WSACleanup(),int   
DECLARE "wsock32.dll",socket(af:int,s_type:int,protocol:int),int   
DECLARE "wsock32.dll",bind(s:INT, addr:pointer, namelen:INT),INT   
DECLARE "wsock32.dll",htons(hostshort:word),int   
DECLARE "wsock32.dll",htonl(hostlong:INT),INT   
DECLARE "wsock32.dll",listen(s:INT, backlog:INT),INT   
DECLARE "wsock32.dll",send(s:int,buf:string,buflen:int,flags:int),int   
DECLARE "wsock32.dll",recv(s:int,buf:string,buflen:int,flags:int),int   
DECLARE "wsock32.dll",accept(s:INT, addr:int, addrlen:INT),INT   
DECLARE "wsock32.dll",closesocket(s:INT),INT   
DECLARE "wsock32.dll",WSAAsyncSelect(s:INT, hWnd:INT, wMsg:INT, lEvent:INT),INT   
DECLARE "ws2_32.dll",WSAGetLastError(),INT 
Declare "kernel32.dll",lstrcpyA(dest:STRING,source:INT),INT   
Declare "user32.dll",FlashWindowEx(pfwi:pointer),int   
DECLARE "advapi32",GetUserNameA(lpBuffer:String,nSize:pointer),int   
DECLARE "ws2_32.dll",inet_ntoa(lIn:UINT),STRING 
DECLARE "ws2_32.dll",getpeername(s:INT, name:sockaddr, namelen:pointer),INT 
Declare GetIP(socnum:int) 
DECLARE ConnectedUsers()   
DECLARE AddSocket(socket:INT)   
TYPE WSADataType   
DEF   wVersion:WORD   
DEF   wHighVersion:WORD   
DEF   strDescription[256]:ISTRING   
DEF   strSystemStatus[128]:ISTRING   
DEF   iMaxSockets:INT   
DEF   iMaxUdpDg:INT   
DEF   lpVendorInfo:int   
ENDTYPE   
TYPE sockaddr_in   
DEF   sin_family:word   
DEF   sin_port:word   
DEF   sin_addr:int   
DEF   sin_zero[8]:ISTRING   
ENDTYPE   
TYPE flash   
DEF   cbSize:INT   
DEF   hwnd:INT   
DEF   dwFlags:INT   
DEF   uCount:INT   
DEF   dwTimeout:INT   
ENDTYPE   
TYPE sockaddr_remote   
DEF   sin_family:word   
DEF   sin_port:word   
DEF   sin_addr:int   
DEF   sin_zero[8]:ISTRING   
ENDTYPE   
'-----------------------------------------   
setid "WSVER2",         0x202   
setid "NO_ERROR",      0   
setid "AF_INET",      2   
setid "SOCK_STREAM",   1   
setid "IPPROTO_TCP",   6   
setid "SOCKET_ERROR",   1   
setid "INADDR_ANY",      0   
setid "WinsockListenEvent",   1025   
setid "WinsockClientEvent",   1026   
setid "MaxConnections",   1   
'-------------------------------WinSock notyfication   
setid "FD_READ",      0x1   
setid "FD_WRITE",      0x2   
setid "FD_OOB",      0x4   
setid "FD_ACCEPT",      0x8   
setid "FD_CONNECT",      0x10   
setid "FD_CLOSE",      0x20 
DEF StructClient:sockaddr_remote   
DEF StructServer:sockaddr_in   
DEF StartupData:WSADataType   
DEF Structflash:flash   
DEF tempsd,mHost:MEMORY   
ALLOCMEM tempsd,1,len(StartupData)   
'FIM WINSOCKDEFS 
'INICIO MUDDEFS 
DECLARE gdh() as string 
'mostrar texto tipo tabela, mas sem limites 
DECLARE trimpad(papos:string,cnum:int,LR:string) 
DECLARE editorgenerico(socketref:int) 
DECLARE juliand(seci:int,mini:int,houri:int,dayi:int,monthi:int,yeari:int,secf:int,minf:int,hourf:int,dayf:int,monthf:int,yearf:int) 
def resultado[4]:int 
DECLARE isLeapYear(yyyy:int) 
'modo de utilizaÃÆ'Ã,§ÃÆ'Ã,£o do juliand: juliand(resultado,a,b,c,...), com resposta nos valores: resultado[0] - seg, [1] - min, [2] - hora, [3] - dia 
DECLARE enviarmsg(outstring:string,socket:int) 
TYPE TERR 
def pathdir:string 
def path:string 
def luznatural:int 
def glance:string:'nome normal 
def aweglance:string:'nome sem awareness 
def describe[2000]:istring:'quando se for fazer print a esta string, fazer para calcular fim de linha (com um space) e depois muda de linha 
def exits:string:' long exitsÂÃ,´short exitsÂÃ,´ 
'para npcaqui e eqaqui: 4 - todo o dia; 3 - todo o dia menos noite escura; 2 - nascer ao por do sol; 1 - sÃÆ'Ã,³ durante quase pico do sol; 0 - pico do sol 
def npcaqui[41]:string:' nÂÃ,ºÃ‚Ã,´NPC nome todoÂÃ,´nome curtoÂÃ,´fileÂÃ,´nome chamada1ÂÃ,´nome chamada2ÂÃ,´nome chamada3ÂÃ,´ 
def eqaqui[41]:string:' nÂÃ,ºÃ‚Ã,´EQ nome todoÂÃ,´nome curtoÂÃ,´fileÂÃ,´nome chamada1ÂÃ,´nome chamada2ÂÃ,´nome chamada3ÂÃ,´ 
def pcaqui[41]:string:' nÂÃ,º:0 aparece, 1 fade/hideÂÃ,´PC nome todoÂÃ,´nome curtoÂÃ,´socketÂÃ,´ 
'var debaixo tem de ter o sistema de, quando chega ao X caracteres, qd encontra o 1ÂÃ,º space muda de linha 
def frasecomtimer[2000,11]:istring 
'pÃÆ'Ã,´r nas var debaixo looks, etc. 1otherlookÂÃ,´2otherlookÂÃ,´respostaÂÃ,´reacÃÆ'Ã,§ÃÆ'Ã,£o se houverÂÃ,´ 
def otherlook[2000,16]:istring 
' var de baixo: exit por extensoÂÃ,´exit abreviadaÂÃ,´file do novo terrainÂÃ,´frase que aparece quando se mudaÂÃ,´ 
def exit[2000,16]:istring 
def areamuchdense:int:'0 nÃÆ'Ã,£o, 1 sim 
def weather:int:'DEFINE A QUE TIPO DE REGIÃÆ'Æ’O PERTENCE EM TERMOS DE METEREOLOGIA. VOU CONSIDERAR 4 TIPOS (DO 1 AO 4, CADA VEZ MELHOR TEMPO)   
def awepts:int:'qts pts de awareness, no mÃÆ'Ã,­nimo, para ver a descriÃÆ'Ã,§ÃÆ'Ã,£o correcta 
def kindofterrain:string:'none, forest, desert, mountain, Brushland, Grassy Hills, Forested Hills, Marsh, Chaparral, Fields, Plains, Beach 
def slotplanted[11]:string:'tag do ficheiro de semente que estiver cÃÆ'Ã,¡ plantado 
def tamanhoroom:int:'padrÃÆ'Ã,£o=2000, para significar 2000m 
def oqueeagora[5000]:istring 
ENDTYPE 
def terrain:terr 
TYPE PC 
    DEF nome,legendinfo,password,prof,raca:string 
def describe[2000]:istring 
    DEF align:INT 
def gender:string 
    DEF surname:string 
    DEF hp,eend:INT 
    DEF maod,maoe:string 
'inicio de slots/layers do inventory do char 
    DEF bracos[4]:string 
    DEF pes[4]:string 
def cabeca[4]:string 
def tronco[4]:string 
def costas[4]:string 
def cintura:string 
def pernas[4]:string 
def maos[4]:string 
    DEF anel[4]:string 
def colar[4]:string 
'fim de slots/layers do inventory do char 
def dia,hora,minuto,segundo:int 
def ageatlogind,ageatloginh,ageatloginm,ageatlogins:int 
def gold,eexp,wimpy:int 
def skill[31]:string:'estas var, mais as 2 de baixo, sÃÆ'Ã,£o genÃÆ'Ã,©ricas mas p dps se tratar e mudar p nome prÃÆ'Ã,³prio, qd se souber quais sÃÆ'Ã,£o mm 
def skillp[31]:int 
def skillpmod[31]:int:'pontos da skill modificados por uso de equipment, por exemplo 
def skillpuso[31]:int 
def comida,bebida:int 
def pesoactual:int 
def visaomaxima:int:'ds 
def visaominima:int:'dsa 
def terreno:string 
def anost,messt,diast,horast,minst,segst,segundolaston,minutolaston,horalaston,dialaston,meslaston,anolaston:int 
def lvlquest:int 
def loggedonoff:int 
def brief:int 
def socket:int 
def anocr,mescr,diacr:int 
def diacrext:string 
def horacr,mincr,segcr:int 
def ooccomm:int:'se 1 ligada, se 0 desligada 
def admin:int:'1, 2 ou 3 se administrador, 0 se nÃÆ'Ã,£o ÃÆ'Ã,© 
def modoeditor[2000]:istring 
def textodoeditor[151]:string 
def deflanguage:string 
def defnews:string 
'saber se estÃÆ'Ã,¡ afk ou nÃÆ'Ã,£o, para aparecer tag, e tempo para dizer ÃÆ'Ã,  quanto estÃÆ'Ã,¡ afk 
def afk,afks,afkm,afkh,afkd,afkme,afka:int:'volÃÆ'Ã,¡til 
def afkreason:string:'volÃÆ'Ã,¡til 
def snoop:int 
def invisible:int 
def silence:int 
def directory:string:'volÃÆ'Ã,¡til 
def copysetdir:string:'volÃÆ'Ã,¡til 
ENDTYPE 
'LISTA DE PLAYER SKILLS 
'SKILLS GERAIS 
'- 1 - awareness 
'LÃÆ'Ã,NGUAS - ver "etnologia da iberia.pdf" 
'- 5 - lÃÆ'Ã,­ngua latina - latin (romanos) 
'- 6 - lÃÆ'Ã,­ngua turdetana - turdetan (sul) 
'- 7 - lÃÆ'Ã,­ngua ibÃÆ'Ã,©rica - iberic 
'- 8 - lÃÆ'Ã,­ngua cÃÆ'Ã,©ltica - celtic 
'- 9 - lÃÆ'Ã,­ngua prÃÆ'Ã,©-celta - lusitan 
'- 10 - 
'- 11 -   
TYPE NPC 
def tipo:string:'npc - monster; nokill - nÃÆ'Ã,£o morre; horse - cavalo; trainer - treinador; shopkeeper - dono de loja 
def standardtext:string:'linha standard que aparece no terreno qd esta NPC estÃÆ'Ã,¡ presente - sÃÆ'Ã,³ depois variarÃÆ'Ã,¡ ficheiro .txt 
def describe[2000]:istring:'quando se for fazer print a esta string, fazer para calcular fim de linha (com um space) e depois muda de linha 
def name,VARIAVELVAZIA1,VARIAVELVAZIA2:string:'nomes reais 
def skill[21]:string:'skills p serem usadas no futuro, juntamente com linha de baixo 
def skillp[21]:int 
def awareness:int 
def align:int 
def gender:string:'male ou female 
def armed:int:'0 weapon wielded, 1 weapon disarmed 
def eexp:int 
def gold:int 
def race:string 
def language:string 
def hp,eend,hpmax,eendmax:int 
def equipamento[11]:string:'   nome que aparece`nome para chamar 1`nome para chamar 2`ficheiro`wield/ /worn` 
'frase - se tiver #, considera um temp tell e actua com language; se nÃÆ'Ã,£o tiver, mostra sÃÆ'Ã,³ a frase. Exemplo: 
'"a man says#: %hello!" - "a man says in lusitan: hello!"/"a man says in a strange tongue: vfiwq!" 
def frasecomtimer[500,11]:istring 
'frase - se tiver #, considera um temp tell e actua com language; se nÃÆ'Ã,£o tiver, mostra sÃÆ'Ã,³ a frase. Exemplo: 
'"a man says#: %hello!" - "a man says in lusitan: hello!"/"a man says in a strange tongue: vfiwq!" 
def fraseemcombate[500,6]:istring 
def reaccaoqdvepc[6]:string 
def fraseautoattack:string 
def hunt:int:' 1 se faz hunt, 0 se nÃÆ'Ã,£o 
def blocksaidaroom:int:' 1 se sim, 0 se nÃÆ'Ã,£o 
def quemataca[21]:string 
def caminhoronda:string:'dir curtaÂÃ,´dir curtaÂÃ,´dir curta... 
def temporoomcaminhoronda:int 
'pÃÆ'Ã,´r nas var debaixo looks, asks, etc, que sÃÆ'Ã,³ aparecem qd NPC existe.   
'1otherlook`2otherlook`resposta`reacÃÆ'Ã,§ÃÆ'Ã,£o se houver`1 se tds no room veem resposta ou 0 se nÃÆ'Ã,£o` 
def otherlook[2000,11]:istring 
ENDTYPE 
def npcmod:npc 
TYPE ITEM 
def tipo:string:'weapon, pack, shield, helmet, ring, bean, gold, corpse 
def tipoespecifico:string 
'- WEAPON - longsword, broadsword, bastard sword, cutlass, sabre, scimitar, shortsword, dagger, rapier, greatsword, mace, hammer, 
' club, spiked, morning stars, axe, spear, long pike, short pike - CHECKAR SE EXISTEM ESTES TIPOS! 
'- BEAN - tipo de semente: wheat - CHECKAR COLHEITAS DA ALTURA! BOLOTAS 
def standardtext:string:'linha standard que aparece no terreno qd esta ITEM estÃÆ'Ã,¡ presente - sÃÆ'Ã,³ depois variarÃÆ'Ã,¡ ficheiro .txt 
def describe[2000]:istring 
def name:string:'nomes reais 
def pricenew:int:'quanto vale nova 
def uso:int:'variÃÆ'Ã,¡vel de uso para, nas lojas, baixar preÃÆ'Ã,§o. Se arma combate muito, esta sobe e o preÃÆ'Ã,§o na loja irÃÆ'Ã,¡ ter em conta o pricenew, 
'o uso e a variÃÆ'Ã,¡vel da prÃÆ'Ã,³pria loja. O uso aumenta com a utilizaÃÆ'Ã,§ÃÆ'Ã,£o da item. 
def bulk:int:'quanto ocupa em tamanho, por comparaÃÆ'Ã,§ÃÆ'Ã,£o a um item bem conhecido e facilmente comparÃÆ'Ã,¡vel 
def weight:int:'quanto pesa - se acima de X peso, usa sempre 2 mÃÆ'Ã,£os para pegar, em gramas ou kilogramas 
def emotes[11]:string:'emotes, se for arma 
def frasewield:string:'frase quando se faz wield ou worn a espada ou armadura/pack/escudo/... 
def fraseremove:string:'frase quando se faz remove ÃÆ'Ã,  item 
def bodypartlayer:string:'string que contÃÆ'Ã,©m todas as bodyparts que utiliza, bem como as layers. Se fÃÆ'Ã,´r braÃÆ'Ã,§os e pernas da layer 3, a string 
'poderÃÆ'Ã,¡ ser "be3bd3pe3pd3"; quando mud tiver de checkar faz instr para o que pretende, e saca tudo 
' - bodyparts: cabeÃÆ'Ã,§a, braÃÆ'Ã,§o d, braÃÆ'Ã,§o e, mÃÆ'Ã,£o d, mÃÆ'Ã,£o e, ombro d, ombro e, peito, tronco, costas (sÃÆ'Ã,³ pack, sÃÆ'Ã,³ 1 layer), cintura, perna d, perna e, 
' pÃÆ'Ã,© d, pÃÆ'Ã,© e, colar, anel 
' - layers por bodypart: 3 
def skill[21]:string:'skills p serem usadas no futuro, juntamente com linha de baixo 
def skillp[21]:int 
'- WEAPON - hitsperturn 
'   - twohands 
'- SHIELD - shieldhitopponent 
'- BEAN - terrainfit (terreno ideal p cultura - corta 50% ao resultado final se diferente) - none 0, forest 1, desert 2, mountain 3 (ver TERR) 
' - weatherlimitup, weatherlimitdown (baliza para ideal weather - por ponto fora, reduz 1% ao resultado final) 
' - harvestlimitup, harvestlimitdown (baliza para time to harvest - por ponto fora, reduz 1% ao resultado final) 
' - price100 (preÃÆ'Ã,§o a que se vai vender colheita se resultado a 100%) 
' - planted (se 1 estÃÆ'Ã,¡, e comeÃÆ'Ã,§a a somar weathersum; se 0 nÃÆ'Ã,£o estÃÆ'Ã,¡ e nÃÆ'Ã,£o soma weathersum) 
' - weathersum (valor da soma dos vÃÆ'Ã,¡rios weather, uma vez semente plantada) 
' - nameharvested (nome depois de feita a colheita - CORRIGIR PORQUE O SKILL PODE SER ESTE, MAS O SKILLP ÃÆ'ââ,¬Â° SÃÆ'ââ,¬Å" P INTS!) 
' - priceharvested (valor depois de feita a colheita, tendo em conta o PRICE100) 
def otherlook[2000,11]:istring 
'pÃÆ'Ã,´r nas var debaixo looks, etc,  que sÃÆ'Ã,³ aparecem qd ITEM estÃÆ'Ã,¡ presente 
'1otherlook`2otherlook`resposta`reacÃÆ'Ã,§ÃÆ'Ã,£o se houver`1 se tds no room veem resposta ou 0 se sÃÆ'Ã,³ wielder` 
def frasecomtimer[500,6]:istring 
'frase`1 ou 0` - a frase ÃÆ'Ã,© a frase; se for 1, ela sÃÆ'Ã,³ aparece ao dono; se for 0, aparece a todos no room - POR ESTAS VAR? 
ENDTYPE 
def itemmod:item 
DECLARE frasemoral() as string 
DECLARE charquit(numberfromtable:int,reason:int) 
DECLARE carregarpersonagem(nomepn:pc) 
DECLARE guardarpersonagem(nomepn:pc) 
DECLARE carregarnpc(nomenpc:string) as int 
DECLARE guardarnpc(nomenpc:string) 
DECLARE entraterreno(nchar:int,ficheironpc:string,terreno:string) 
DECLARE saiterreno(nchar:int,ficheironpc:string,terreno:string) 
DECLARE printterreno(nchar:int,terreno:string) 
DECLARE carregarterreno(terreno:string) 
DECLARE infopplroom(nchar:int,terreno:string,frase:string) 
DECLARE infoiberia(ooc:int,frase:string):'se ooc=1 ÃÆ'Ã,© sÃÆ'Ã,³ para quem tem ooc line 
'INICIO DE DEFS PARA DIRECTORY STRUCTURE ONLINE 
CONST FILE_ATTRIBUTE_ARCHIVE = 0x20 
CONST FILE_ATTRIBUTE_COMPRESSED = 0x800 
CONST FILE_ATTRIBUTE_DEVICE = 0x40 
CONST FILE_ATTRIBUTE_DIRECTORY = 0x10 
CONST FILE_ATTRIBUTE_ENCRYPTED = 0x4000 
CONST FILE_ATTRIBUTE_HIDDEN = 0x2 
CONST FILE_ATTRIBUTE_NORMAL = 0x80 
CONST FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x2000 
CONST FILE_ATTRIBUTE_OFFLINE = 0x1000 
CONST FILE_ATTRIBUTE_READONLY = 0x1 
CONST FILE_ATTRIBUTE_REPARSE_POINT = 0x400 
CONST FILE_ATTRIBUTE_SPARSE_FILE = 0x200 
CONST FILE_ATTRIBUTE_SYSTEM = 0x4 
CONST FILE_ATTRIBUTE_TEMPORARY = 0x100 
DECLARE "kernel32.dll",GetFileAttributesA(lpFileName:STRING),INT 
'FIM DE DEFS PARA DIRECTORY STRUCTURE ONLINE 
'FIM MUDDEFS 
'INICIO DE DEFS LINHA DE COMANDOS 
SETID "ENMKEYEVENTS",0x10000 
SETID "ENMSGFILTER",0x700 
TYPE MSGFILTER 
def hwndFrom:INT 
def idFrom:INT 
def code:INT 
def msg:INT 
def wparam:INT 
def lparam:INT 
ENDTYPE 
DEF mf:MSGFILTER 
DEF mem:MEMORY 
'FIM DE DEFS DE LINHA DE COMANDOS 
DECLARE printf(text:string)   
def d1:dialog   
CreateDialog d1,0,0,700,500,0x80CA0080,0,"Iberia Server Window",&HandlerUser   
CONTROL d1,@Edit,"",0,0,700,485,0x50A00004,1
CONTROL d1,@RichEdit,"",0,485,700,15,@CTEDITMULTI|@VSCROLL|@CTEDITRETURN,2
def MaxSockets,event:int   
DEF iResult,m_socket,ListenOut,Ready,WinSock,LenName,check,check2,check3,razao:int   
DEF INVALID_SOCKET,host,addr,RetSel,ReceivedBytes,SelectOps:int   
def backupfile:file   
DEF Port:word   
DEF bufor[32768],helpstring[32768]:istring   
DEF WelcomeMessage,KickMessage,PingMessage,localname,UserName,MyIP:string   
def BuforPointer,AddrPointer,NULLPointer:pointer   
def texto,texto2,texto3,path,pathnpc,patheq,pathclone,pathpc,pathterr,volatil,volatil2,volatil3,volatil4:string 
def hertbeattimer,visaototal,visaodia:int 
def linhascreen,temp:string 
def anoupt,mesupt,diaupt,horaupt,minupt,segupt:int 
DEF dir,dir2,boiint,col1,col2,col3,col4,boi2,temp1,temp2:INT 
DEF dirfile,dirfile2,vaca,boi:STRING 
linhascreen="+-------------------------------------------------------------------------------+" 
def gen1,gen2,genpc,gennpc,geneq,genclone,genterr:file 
def textodaalturadodia,textoprint,textometereologia[5],textometereologiaprint[5]:string 
def metereologian[5]:int 
def counterfraseterreno,randomfraseterreno,countermetereologia,fasedodia,counternpctell,randomfrasenpctell,counterautosave:int 
def terraintype[5],tt,serverlcerror,segtemp,mintemp,horatemp,diatemp,counteralturadodia,divisaodia:int 
def tmp,tm,passd1,passd2,passd3:string 
def tmn:int 
def exitext,exitabrev,filenovoterr,frase,news1,news2,news3,news4,tell1,tell2,emote1,emote2,emote3,temporario:string 
def pos1,pos2,pos3,pos4,pos5,pos6,pos7,error:int 
counterfraseterreno=0:randomfraseterreno=0:countermetereologia=0:serverlcerror=0 
'define o valor mÃÆ'Ã,©dio para os 4 tipos de metereologia por ÃÆ'Ã,¡rea 
terraintype[1]=3 
terraintype[2]=4 
terraintype[3]=5 
terraintype[4]=6 
for c=1 to 4 
tt=terraintype[c] 
gosub metereologia 
textometereologiaprint[c]=tmp 
textometereologia[c]=tm 
next c 
textodaalturadodia = "The sun is rising on the eastern horizon.":visaodia = -10:fasedodia=2 
textoprint="The sun appears at the edge of the eastern sky." 
counteralturadodia=1 
divisaodia=1 
counternpctell=0 
counterautosave=0 
path=getstartpath+"data\\" 
pathnpc=getstartpath+"data\\npc\\" 
patheq=getstartpath+"data\\eq\\" 
pathclone=getstartpath+"data\\clone\\" 
pathpc=getstartpath+"data\\pc\\" 
pathterr=getstartpath+"data\\terrain\\" 
BuforPointer=bufor : NULLPointer=0 : LenName=255   
WelcomeMessage="iberiastart.sup" 
KickMessage="Maximum players in Iberia already reached. Please visit us later!" 
PingMessage=""   
AddrPointer = addr   
INVALID_SOCKET=-1   
Port=5900 
heartbeattimer=1000 
SelectOps=@FD_READ|@FD_WRITE|@FD_ACCEPT|@FD_CONNECT|@FD_CLOSE   
MaxSockets=10 
'a linha de baixo ÃÆ'Ã,© +2 pq 1 ÃÆ'Ã,© por causa dos for a=1 to qq coisa e o outro ÃÆ'Ã,© para fazer o load a um char temporÃÆ'Ã,¡rio 
def SockChar[MaxSockets+2]:pc:'nome temporÃÆ'Ã,¡rio dos sockets livres, tendo em conta o nÃÆ'Ã,ºmero de jogadores mÃÆ'Ã,¡ximo 
def SockTable[MaxSockets]:int 
def SockTableName[MaxSockets]:string 
def SocketLC[MaxSockets]:string 
def SockEstado[MaxSockets+2]:int 
def SocketPassTemp[MaxSockets]:string 
def terrenosdosplayers[maxsockets]:string 
for a=0 to MaxSockets-1 
SocketLC[a]="" 
SockTable[a]=0 
SockTableName[a]="" 
SockEstado[a]=0 
SocketPassTemp[a]="" 
terrenosdosplayers[a]="" 
sockchar[a].afk=0 
next a 
showdialog d1 : Ready=1   
   Structflash.cbSize=len(StructFlash)   
   Structflash.hwnd=d1   
   Structflash.dwFlags=7|12   
   Structflash.uCount=0   
   Structflash.dwTimeout=0   
waituntil Ready=0   
' Canceling socket-notyfications and closing all used sockets   
for addr=0 to MaxSockets-1   
WSAAsyncSelect(SockTable[addr], d1, 0, 0)   
closesocket(SockTable[addr])   
next addr   
WSACleanup()   
freemem tempsd : closedialog d1   
END   

' 20 lines converted from 434 lines Read by S2P v1.03


And gave this error:
Compiling...
EBASIC1.eba
File: C:\EBASIC1.eba (81) syntax error - as
Error(s) in compiling "C:\EBASIC1.eba"


Even when I fixed that on declares, still gives more and more errors:
Compiling...
EBASIC1.eba
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (81) syntax error
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (260) syntax error
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (264) syntax error
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (291) duplicate ID - 0x10000
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (306) undefined variable - HandlerUser
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (306) Invalid & operation
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (339) undefined variable - c
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (339) undefined variable - c
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (339) invalid argument
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (340) undefined variable - c
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (340) subscript wrong type
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (341) Warning: undeclared function 'metereologia'
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (342) undefined variable - c
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (342) subscript wrong type
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (343) undefined variable - c
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (343) subscript wrong type
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (344) undefined variable - c
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (364) undefined variable - heartbeattimer
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (368) unknown constant - pc
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (369) duplicate definition of variable or label - int
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (370) duplicate definition of variable or label - string
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (371) duplicate definition of variable or label - string
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (372) unknown constant - int
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (373) duplicate definition of variable or label - string
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (374) duplicate definition of variable or label - string
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (375) undefined variable - a
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (375) undefined variable - a
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (375) invalid argument
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (376) undefined variable - a
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (376) subscript wrong type
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (377) undefined variable - a
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (377) subscript wrong type
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (378) undefined variable - a
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (378) subscript wrong type
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (379) undefined variable - a
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (379) subscript wrong type
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (380) undefined variable - a
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (380) subscript wrong type
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (381) undefined variable - a
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (381) subscript wrong type
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (382) undefined variable - a
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (382) subscript wrong type
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (383) undefined variable - a
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (386) invalid assignment
File: C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba (393) no appropriate conversion exists - )
Error(s) in compiling "C:\Documents and Settings\12229400\Os meus documentos\ProgramaÃÆ'Ã,§ÃÆ'Ã,£o\Iberia MUD - IBASIC\EBASIC1.eba"


Sorry to bug you abit more
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

LarryMc

A few things I see right off the bat:

There are multiple functions that are declared like this:
DECLARE gdh() as string  ; which is incorrect
DECLARE gdh(),string  is the correct way.

At the beginning of your program there is this statement:
AutoDefine "Off"
When that command is used with "off" it indicates that all program variables must be defined before being used.
That's creating a whole lot of errors.

Got some 'duplicate ID' errors on constants such as this:
SETID "ENMKEYEVENTS",0x10000
They are already defined in the incc files in EBasic.

Get all those fixed and try again.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Ionic Wind Support Team

Just an FYI, The converter was made by Steve Boothman, rest his soul.  It was made long ago when Pro was first released, there were hundred of changes in Pro since then, and of course Emergence is a different language which is only 99% compatible with Pro.

So the bottom line is you will have to manually edit a lot of code, it is par for the course.

Paul.
Ionic Wind Support Team

JoaoAfonso

I am just a newbie in EBASIC, but again as posted in other forum, I am getting used to it.

And that was understud, Paul. There is no other converter around? By your answer, there isn't :) Anyway was nice.

Later on, when I control EB abit more, I'll try to convert that code. Thank you for the advices and information
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900