Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - breh

Pages: [1]
1
Ok this is making me crazy.

I'm trying to cycle through a certain number of names, and passing them on to scanjournal within a sub. The problem is that while I can get the names to be in the %1 %2 %3 etc. variables, when I call the gosub within the sub, it overwrites the %2 %3 with its own %2 %3 variables. How do I avoid that?

Here is a code tidbit:

Code: [Select]



gosub example_goSub name1 name2 name3 name4


sub example_goSub
set %_cnt 1
while %_cnt < %0
{
set %message
display ok MSG: %message % . %_cnt , #spc
   set %message % . %_cnt , #spc
   display ok MSG: %message %_cnt
   gosub TM_AdvJournalScan network VALID_ADVANCE %message hi
   display ok MSNG2: %message %_cnt
;set %_cnt %_cnt + 1
display ok %_cnt
}
return



sub TM_AdvJournalSync
  namespace push
  namespace local TM_AdvJS_ , %1
  set !_jindex #jindex + 1
  if %0 > 1
    set !lpc_set %2
  namespace pop
  set !TM_FunctionCalled #TRUE
return

sub TM_AdvJournalScan
  namespace push
  namespace local TM_AdvJS_ , %1
  set !args %2
  set !temp_lpc #LPC
  if !lpc_set = N/A
    set #LPC 1000
  else
    set #LPC !lpc_set
  set !num_args %0
  if VALID in !args
  {
     set !charname %3
     set !first_arg 4
  }
  else
      set !first_arg 3
  if !_jindex = N/A
    set !_jindex #jindex
  if !charname = N/A
  {
    set !charname #CHARNAME
    AdvJournalScan_loop1:
      str pos !charname #SPC
      if #STRRES <> 0
      {
        set !val #STRRES - 1
        str left !charname !val
        set !left #STRRES
        set !val !val + 1
        str del !charname 1 !val
        set !charname !left , _ , #STRRES
        goto AdvJournalScan_loop1
      }
  }
  set !index !first_arg
  repeat
    set !temp_jindex !_jindex
    set !text % . !index
    while !temp_jindex <= #jindex
    {
      scanjournal !temp_jindex
      str pos #JOURNAL !charname 1
      set !namepos #STRRES
      str count #JOURNAL !charname
      set !namecnt #STRRES
      str pos #JOURNAL :_ 1
      set !smcpos #STRRES
      str pos #JOURNAL !text 1
      set !textpos #STRRES
      if !textpos < !smcpos && !smcpos <> 0 || !smcpos = 1 || :_ notin #JOURNAL || VALID notin !args
        set !pass #TRUE
      else
        set !pass #FALSE
      if ( !text in #journal && ( ( !namepos = 1 && !namecnt <= 1 ) || !pass ) )
      {
        set !temp_jindex !temp_jindex + 1
        if ADVANCE in !args
          set !_jindex !temp_jindex
        set #LPC !temp_lpc
        namespace pop
        set !TM_FunctionCalled #TRUE
        return #TRUE
      }
      set !temp_jindex !temp_jindex + 1
    }
    set !index !index + 1
  until !index - !first_arg > !num_args - !first_arg
  set #LPC !temp_lpc
  namespace pop
  set !TM_FunctionCalled #TRUE
return #FALSE

2
New member introductions / Hi I'm Breh!
« on: March 02, 2011, 09:21:29 PM »
Hi I am Breh, 22 years old from Sweden but currently living in Denmark.

I am basically interested in learning how to script and in my pursuit of learning I found this site. I've played UO back in 2001 for 2 years and have started playing UO again on freeshards with a few friends. I look forward to soaking up knowledge and hopefully I can share some ideas and scripts myself.

The site seems a bit overwhelming at first, but seems like dedicated forces are running it so I shall figure it out for sure!

Thanks for reading and hope to become part of the community!

PS. Breh is a play on the word Bro, or Brah, I'm European but have always found it funny how Yanks all call each other Bro, Brah, Breh, Brow etc. so yeah, don't tase me breh! (not everyone will get that!) :)

Edit: Okay so I got "4406 unread posts." haha I feel overwhelmed already!!! and what's the fasination with LOLcats on this site?? Sure you can haz some Hartwud kitty! :-)

Pages: [1]