Locations Names ?

Ask for help

Moderators: Murderator+, Murderator

Post Reply
mTr
Posts: 5
Joined: 2009-03-20 23:20:28

Locations Names ?

Post by mTr »

Hello, i was wondering if i can get a variable with the name of the zone i am. I dont need X and Y, just the name... for example, Despise, Destard, Britain... Etc.

Thanks in advance.
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

.where

it works ?
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
mTr
Posts: 5
Joined: 2009-03-20 23:20:28

Post by mTr »

lol! i know that. But i want use the location for guild warning.... i mean: .g HELP IM IN (LOCATION) :P
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

need no help? - ok, only little hint -)

use .where, grab message from journal, then send guild warning.

Injection have no special command for u.
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
mTr
Posts: 5
Joined: 2009-03-20 23:20:28

Post by mTr »

ahh, you'r right, never thinked it. Thanks :)
mTr
Posts: 5
Joined: 2009-03-20 23:20:28

Post by mTr »

Hi again, just wanna show you how my script is. Maybe you can help me improve it, but at the moment it does the job fine. Don't be evil with me, is my 1st script :P.

Code: Select all

#AVISO GUILD

sub Aviso()
VAR p='N/A'
VAR x=UO.GetZ()
UO.DeleteJournal()
UO.sayu('.where')
wait(500)
if UO.InJournal('I am in') then
   p=UO.Journal(0)
   p=Mid(trim(p), 10+len('mTr'), 100)
   UO.sayu(',resend')
endif
if x>200 then
   UO.sayu('.gsay HELP | AYUDA @ ' + Left(p, len(p)-15))
endif
if x==0 then
   UO.sayu('.gsay HELP | AYUDA @ ' + Left(p, len(p)-11))
endif
if x<230 and x>9 then
   UO.sayu('.gsay HELP | AYUDA @ ' + Left(p, len(p)-14))
endif
if x>0 and x<10 then
   UO.sayu('.gsay HELP | AYUDA @ ' + Left(p, len(p)-13))
endif
end sub


All this repetitions is for checking Z and do the conversion of the string removing the cords, but still works with a bit of delay cause server don't send Z at every move (i think) and even with resend it fails sometimes. Is it there a better way to check it ? I tested with else's, but i dont know why isnt working with. so I had to use 4 if's.

Oh, btw, change 'mTr' with your name.
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Code: Select all

sub aviso()
   var loc, msg = 'I am in '
   deljournal( msg )
   uo.msg( '.where' )
   repeat
      wait( 100 )
   until uo.injournal( msg )
   loc = uo.journal( uo.injournal( msg ) -1 )
   loc = explode( loc, msg, 1 )
   loc = explode( loc, ' (', 0 )
   uo.msg( '.gsay HELP | AYUDA @ ' + loc )
endsub


Its may be better.

PS: sub explode: viewtopic.php?p=55737#55737

PPS: I was asked about .where because on some shards this command isnt works.
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
mTr
Posts: 5
Joined: 2009-03-20 23:20:28

Post by mTr »

ooh, i forgot explode :P I come from php and c# so in both work this function :) but didnt know it was in c++ too. Still a newbie on it hehehe.

Thanks for you help man.
Post Reply