func Script40() { SetPlrShowControl(0,"___345678_ 345678 ______67__"); TutorialMessage("$TxtNowmovetotheveryleft$"); wait(15); SetArrow(465,295); }
func Script50() { SetPlrShowControl(0,"____4_678_ 4 678 __________"); CreateObject(FLAG,40,-10,0); SetArrow(45, 210); TutorialMessage("$TxtJumponthehilltoyourl$"); }
func Script150() { SetPlrShowControl(0,"___34_678_ 34 678 __________"); var pGold = CreateObject(GOLD,130,330); TutorialMessage("$TxtNowwalkbacktothevall$"); SetArrow(220, 271); }
void COXCopyTree::WalkTree(WORD wLevel) { static COXDirSpec UpDir(_T("..")); short nReturn; #ifndef WIN32 struct _find_t findStruct; #else HANDLE hSearch; WIN32_FIND_DATA w32FindBuf; #endif // make sure the getcurrentdirectory worked correctly if (!m_SourceDir.DoGetCurrentDir()) { m_nStatus = F_GETCURRENTDIR; return; } #ifndef WIN32 UINT uReturn = _dos_findfirst(_T("*.*"),_A_SUBDIR|_A_NORMAL,&findStruct); if (uReturn != 0) #else hSearch=FindFirstFile(_T("*"),&w32FindBuf); if (hSearch == (HANDLE)INVALID_HANDLE_VALUE) #endif { if (wLevel) { m_DestDir.RemoveLastSubdirectory(); if (!UpDir.DoSetCurrentDir()) { m_nStatus = F_SETCURRENTDIR; } } return; } for (;;) { // if this file is .. or . then get next and continue #ifndef WIN32 if (strcmp(findStruct.name,_T(".")) == 0 || strcmp(findStruct.name,_T("..")) == 0) { if (_dos_findnext(&findStruct)) #else if (_tcscmp(w32FindBuf.cFileName,_T(".")) == 0 || _tcscmp(w32FindBuf.cFileName,_T("..")) == 0) { if (FindNextFile(hSearch, &w32FindBuf) == FALSE) #endif { if (!UpDir.DoSetCurrentDir()) { m_nStatus = F_SETCURRENTDIR; } #ifdef WIN32 FindClose(hSearch); #endif m_DestDir.RemoveLastSubdirectory(); return; } continue; } // if this is a directory walk it #ifndef WIN32 if (findStruct.attrib & _A_SUBDIR) { if (!m_SourceDir.AppendDirectory(COXDirSpec(findStruct.name)) || !m_SourceDir.DoSetCurrentDir()) #else if (w32FindBuf.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if (!m_SourceDir.AppendDirectory(COXDirSpec(w32FindBuf.cFileName)) || !m_SourceDir.DoSetCurrentDir()) #endif { TRACE(_T("COXCopyTree::WalkTree : Could not set '%s' as current dir \n"), LPCTSTR(m_SourceDir.GetDirectory())); m_nStatus = F_SETCURRENTDIR; #ifdef WIN32 FindClose(hSearch); #endif return; } #ifndef WIN32 m_DestDir.AppendDirectory(COXDirSpec(findStruct.name)); #else m_DestDir.AppendDirectory(COXDirSpec(w32FindBuf.cFileName)); #endif m_BufferDir.DoGetCurrentDir(); if (!m_DestDir.Exists()) { if (!m_DestDir.DoMakeNew()) { TRACE(_T("COXCopyTree::WalkTree : Could not create '%s' \n"), LPCTSTR(m_DestDir.GetDirectory())); m_nStatus = F_CREATEDIR; #ifdef WIN32 FindClose(hSearch); #endif return; } else // add this directory to list of created dirs { if ((nReturn = m_dsDirs.Add(m_DestDir.GetDirectory())) != SUCCESS) { TRACE(_T("COXCopyTree::WalkTree : Could not add '%s' to recovery List\n"), LPCTSTR(m_DestDir.GetDirectory())); m_nStatus = nReturn; #ifdef WIN32 FindClose(hSearch); #endif return; } } } m_BufferDir.DoSetCurrentDir(); WalkTree(++wLevel); // if anything failed then walk back up the tree if (m_nStatus != SUCCESS) if (m_nStatus != SUCCESS) { #ifdef WIN32 FindClose(hSearch); #endif return; } m_SourceDir.RemoveLastSubdirectory(); } else { // else it is a file copy it COXFileSpec FileSpec; #ifndef WIN32 FileSpec.SetFileName(findStruct.name); #else FileSpec.SetFileName(w32FindBuf.cFileName); #endif m_SourcePath.SetPath(m_SourceDir, FileSpec); m_DestPath.SetPath(m_DestDir, FileSpec); // Check if the user hit the cancel button if (m_pCpyStatDlg != NULL && m_pCpyStatDlg->IsCancelled()) { TRACE(_T("COXCopyTree::WalkTree : User Cancelled copy process, returning...\n")); m_nStatus = F_CANCEL; #ifdef WIN32 FindClose(hSearch); #endif return; } else { if (m_pCpyStatDlg != NULL) { m_pCpyStatDlg->SetStatusText(COXCopyStatusDialog::CSCopying, m_SourcePath.GetPath(), m_DestPath.GetPath()); } if (!m_SourcePath.DoCopy(m_DestPath)) { TRACE(_T("COXCopyTree::WalkTree : Could not copy '%s' to '´%s'\n"), LPCTSTR(m_SourcePath.GetPath()), LPCTSTR(m_DestPath.GetPath())); m_nStatus = F_COPYFILE; #ifdef WIN32 FindClose(hSearch); #endif return; } // add this file to list of created files if ((nReturn = m_dsFiles.Add(m_DestPath.GetPath())) != SUCCESS) { TRACE(_T("COXCopyTree::WalkTree : Could not add '%s' to recovery List\n"), LPCTSTR(m_DestPath.GetPath())); m_nStatus = nReturn; #ifdef WIN32 FindClose(hSearch); #endif return; } } } #ifndef WIN32 if (_dos_findnext(&findStruct)) #else if (FindNextFile(hSearch, &w32FindBuf) == FALSE) #endif { if (!UpDir.DoSetCurrentDir()) { m_nStatus = F_SETCURRENTDIR; } #ifdef WIN32 FindClose(hSearch); #endif m_DestDir.RemoveLastSubdirectory(); return; } } } void COXCopyTree::CleanUp() { LPTSTR lpsz; COXPathSpec CreatedFile; COXDirSpec CreatedDir; // check for required clean up if (m_nStatus != SUCCESS) { m_nStatus = F_CANCEL; if (m_dsDirs.GetCount() || m_dsFiles.GetCount()) { TRACE(_T("COXCopyTree::CleanUp : Several Files and/or dirs found to remove\n STARTING CLEAN PROCESS\n\n")); // hourglass SetHourGlass(); // update the look of the copystat dialog to remove format if (m_pCpyStatDlg != NULL) { m_pCpyStatDlg->SetWindowText(_T("Removal Status")); } // iterate the files for (lpsz = m_dsFiles.GetFirst(); lpsz; lpsz = m_dsFiles.GetNext()) { // tell the user what is being removed if (m_pCpyStatDlg != NULL) { m_pCpyStatDlg->SetStatusText(COXCopyStatusDialog::CSRemoving, lpsz); } CreatedFile.SetPath(lpsz); TRACE(_T("\tCOXCopyTree::CleanUp : Removing File '%s'\n"), LPCTSTR(CreatedFile.GetPath())); if (CreatedFile.DoRemove() == FALSE) { // remove dirs and files for double list m_dsDirs.RemoveAll(); m_dsFiles.RemoveAll(); SetArrow(); return; } } // iterate the dirs backwards for (lpsz = m_dsDirs.GetLast(); lpsz; lpsz = m_dsDirs.GetPrev()) { // tell the user what is being removed if (m_pCpyStatDlg != NULL) { m_pCpyStatDlg->SetStatusText(COXCopyStatusDialog::CSRemoving, lpsz); } CreatedDir.SetDirectory(lpsz); TRACE(_T("\tCOXCopyTree::CleanUp : Removing Dir '%s'\n"), LPCTSTR(CreatedDir.GetDirectory())); if (CreatedDir.DoRemove() == FALSE) { // remove dirs and files for double list m_dsDirs.RemoveAll(); m_dsFiles.RemoveAll(); SetArrow(); return; } } } } // remove dirs and files for double list m_dsDirs.RemoveAll(); m_dsFiles.RemoveAll(); SetArrow(); return; } void COXCopyTree::SetHourGlass() { m_hCursor = LoadCursor(NULL, IDC_WAIT); m_hCursor = SetCursor(m_hCursor); }
func Script72() { var cabin = FindObject(HUT2); SetArrow(583, 120); TutorialMessage("$TxtNowmovetothecabinont$"); }